Class ChCorePatient

java.lang.Object
org.hl7.fhir.r4.model.Base
org.hl7.fhir.r4.model.BaseResource
org.hl7.fhir.r4.model.Resource
org.hl7.fhir.r4.model.DomainResource
org.hl7.fhir.r4.model.Patient
org.projecthusky.fhir.emed.ch.common.resource.ChCorePatient
All Implemented Interfaces:
ca.uhn.fhir.model.api.IElement, Serializable, org.hl7.fhir.instance.model.api.IAnyResource, org.hl7.fhir.instance.model.api.IBase, org.hl7.fhir.instance.model.api.IBaseHasExtensions, org.hl7.fhir.instance.model.api.IBaseHasModifierExtensions, org.hl7.fhir.instance.model.api.IBaseResource, org.hl7.fhir.instance.model.api.IDomainResource
Direct Known Subclasses:
ChCorePatientEpr

public class ChCorePatient extends org.hl7.fhir.r4.model.Patient
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.hl7.fhir.r4.model.Patient

    org.hl7.fhir.r4.model.Patient.ContactComponent, org.hl7.fhir.r4.model.Patient.LinkType, org.hl7.fhir.r4.model.Patient.LinkTypeEnumFactory, org.hl7.fhir.r4.model.Patient.PatientCommunicationComponent, org.hl7.fhir.r4.model.Patient.PatientLinkComponent
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected @Nullable List<PatientCitizenship>
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    protected @Nullable org.hl7.fhir.r4.model.Address
     
    protected @Nullable List<org.hl7.fhir.r4.model.Address>
     
    protected @Nullable org.hl7.fhir.r4.model.CodeableConcept
     
    static final String
     

    Fields inherited from class org.hl7.fhir.r4.model.Patient

    active, ACTIVE, address, ADDRESS, ADDRESS_CITY, ADDRESS_COUNTRY, ADDRESS_POSTALCODE, ADDRESS_STATE, ADDRESS_USE, birthDate, BIRTHDATE, communication, contact, DEATH_DATE, deceased, DECEASED, EMAIL, FAMILY, gender, GENDER, GENERAL_PRACTITIONER, generalPractitioner, generalPractitionerTarget, GIVEN, identifier, IDENTIFIER, INCLUDE_GENERAL_PRACTITIONER, INCLUDE_LINK, INCLUDE_ORGANIZATION, LANGUAGE, link, LINK, managingOrganization, managingOrganizationTarget, maritalStatus, multipleBirth, name, NAME, ORGANIZATION, PHONE, PHONETIC, photo, SP_ACTIVE, SP_ADDRESS, SP_ADDRESS_CITY, SP_ADDRESS_COUNTRY, SP_ADDRESS_POSTALCODE, SP_ADDRESS_STATE, SP_ADDRESS_USE, SP_BIRTHDATE, SP_DEATH_DATE, SP_DECEASED, SP_EMAIL, SP_FAMILY, SP_GENDER, SP_GENERAL_PRACTITIONER, SP_GIVEN, SP_IDENTIFIER, SP_LANGUAGE, SP_LINK, SP_NAME, SP_ORGANIZATION, SP_PHONE, SP_PHONETIC, SP_TELECOM, telecom, TELECOM

    Fields inherited from class org.hl7.fhir.r4.model.DomainResource

    contained, extension, modifierExtension, text

    Fields inherited from class org.hl7.fhir.r4.model.Resource

    id, implicitRules, language, meta

    Fields inherited from interface org.hl7.fhir.instance.model.api.IAnyResource

    RES_ID, SP_RES_ID

    Fields inherited from interface org.hl7.fhir.instance.model.api.IBaseResource

    INCLUDE_ALL, WILDCARD_ALL_SET
  • Constructor Summary

    Constructors
    Constructor
    Description
    Empty constructor for the parser.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.hl7.fhir.r4.model.Identifier
    addIdentifier(String system, String value)
    Adds a new local patient identifier.
     
    void
    copyValues(org.hl7.fhir.r4.model.Patient dst)
     
    Gets the list of citizenships for the patient.
    List<org.hl7.fhir.r4.model.Identifier>
    Resolves the first local patient identifier or throws.
    List<@NonNull org.hl7.fhir.r4.model.Address>
    Gets the list of places of origin for the patient.
    boolean
    Returns whether the citizenship of the patient is specified.
    boolean
    Returns whether religion code exists.
    boolean
    Returns the place of origin of the patient is specified.
    boolean
    Returns whether religion code exists.
    @Nullable org.hl7.fhir.r4.model.Address
    Resolves the address.
    Resolves the patient's birthdate or throws.
    List<@NonNull org.hl7.fhir.r4.model.ContactPoint>
    Fetches the list of contact points which are an email address.
    List<@NonNull String>
    Fetches the list of email addresses values.
    List<@NonNull String>
    resolveEmailAddressesAsStrings(boolean activeOnly)
    Fetches the list of email address values, optionally checking if the period is valid at the moment.
    org.hl7.fhir.r4.model.Enumerations.AdministrativeGender
    Resolves patient's gender if possible.
    @Nullable org.hl7.fhir.r4.model.Patient.PatientCommunicationComponent
    Resolves the language of correspondence (i.e.
    org.hl7.fhir.r4.model.HumanName
    Resolves the human name.
    List<@NonNull org.hl7.fhir.r4.model.ContactPoint>
    Fetches the list of contact points which are a phone number.
    List<@NonNull String>
    Fetches the list of phone number values.
    List<@NonNull String>
    resolvePhoneNumbersAsStrings(boolean activeOnly)
    Fetches the list of email address values, optionally checking if the period is valid at the moment.
    Resolves the patient's religion.
    Sets the patient's birthdate.
    Sets patient's religion.

    Methods inherited from class org.hl7.fhir.r4.model.Patient

    addAddress, addAddress, addChild, addCommunication, addCommunication, addContact, addContact, addGeneralPractitioner, addGeneralPractitioner, addIdentifier, addIdentifier, addLink, addLink, addName, addName, addPhoto, addPhoto, addTelecom, addTelecom, equalsDeep, equalsShallow, fhirType, getActive, getActiveElement, getAddress, getAddressFirstRep, getBirthDate, getBirthDateElement, getCommunication, getCommunicationFirstRep, getContact, getContactFirstRep, getDeceased, getDeceasedBooleanType, getDeceasedDateTimeType, getGender, getGenderElement, getGeneralPractitioner, getGeneralPractitionerFirstRep, getGeneralPractitionerTarget, getIdentifier, getIdentifierFirstRep, getLink, getLinkFirstRep, getManagingOrganization, getManagingOrganizationTarget, getMaritalStatus, getMultipleBirth, getMultipleBirthBooleanType, getMultipleBirthIntegerType, getName, getNamedProperty, getNameFirstRep, getPhoto, getPhotoFirstRep, getProperty, getResourceType, getTelecom, getTelecomFirstRep, getTypesForProperty, hasActive, hasActiveElement, hasAddress, hasBirthDate, hasBirthDateElement, hasCommunication, hasContact, hasDeceased, hasDeceasedBooleanType, hasDeceasedDateTimeType, hasGender, hasGenderElement, hasGeneralPractitioner, hasIdentifier, hasLink, hasManagingOrganization, hasMaritalStatus, hasMultipleBirth, hasMultipleBirthBooleanType, hasMultipleBirthIntegerType, hasName, hasPhoto, hasTelecom, isEmpty, listChildren, makeProperty, removeChild, setActive, setActiveElement, setAddress, setBirthDate, setBirthDateElement, setCommunication, setContact, setDeceased, setGender, setGenderElement, setGeneralPractitioner, setIdentifier, setLink, setManagingOrganization, setManagingOrganizationTarget, setMaritalStatus, setMultipleBirth, setName, setPhoto, setProperty, setProperty, setTelecom, typedCopy

    Methods inherited from class org.hl7.fhir.r4.model.DomainResource

    addContained, addExtension, addExtension, addExtension, addModifierExtension, addModifierExtension, checkNoModifiers, copyValues, getContained, getExtension, getExtensionByUrl, getExtensionsByUrl, getModifierExtension, getModifierExtensionsByUrl, getText, hasContained, hasExtension, hasExtension, hasModifierExtension, hasText, setContained, setExtension, setModifierExtension, setText

    Methods inherited from class org.hl7.fhir.r4.model.Resource

    copyValues, getId, getIdBase, getIdElement, getIdPart, getImplicitRules, getImplicitRulesElement, getLanguage, getLanguage, getLanguageElement, getMeta, hasId, hasIdElement, hasImplicitRules, hasImplicitRulesElement, hasLanguage, hasLanguageElement, hasMeta, setId, setIdBase, setIdElement, setImplicitRules, setImplicitRulesElement, setLanguage, setLanguageElement, setMeta

    Methods inherited from class org.hl7.fhir.r4.model.BaseResource

    getStructureFhirVersionEnum, isResource, setId

    Methods inherited from class org.hl7.fhir.r4.model.Base

    castToAddress, castToAnnotation, castToAttachment, castToBase64Binary, castToBoolean, castToCanonical, castToCode, castToCodeableConcept, castToCoding, castToContactDetail, castToContactPoint, castToContributor, castToDataRequirement, castToDate, castToDateTime, castToDecimal, castToDosage, castToDuration, castToElementDefinition, castToExpression, castToExtension, castToHumanName, castToId, castToIdentifier, castToInstant, castToInteger, castToMarkdown, castToMarketingStatus, castToMeta, castToMoney, castToNarrative, castToOid, castToParameterDefinition, castToPeriod, castToPopulation, castToPositiveInt, castToProdCharacteristic, castToProductShelfLife, castToQuantity, castToRange, castToRatio, castToReference, castToRelatedArtifact, castToResource, castToSampledData, castToSignature, castToSimpleQuantity, castToString, castToSubstanceAmount, castToTime, castToTiming, castToTriggerDefinition, castToType, castToUnsignedInt, castToUri, castToUrl, castToUsageContext, castToXhtml, castToXhtmlString, children, clearUserData, compareDeep, compareDeep, compareDeep, compareDeep, compareValues, compareValues, copyValues, dateTimeValue, equals, getChildByName, getFormatCommentsPost, getFormatCommentsPre, getNamedProperty, getUserData, getUserInt, getUserString, getXhtml, hasFormatComment, hasPrimitiveValue, hasType, hasUserData, isBooleanPrimitive, isDateTime, isMetadataBased, isPrimitive, listChildrenByName, listChildrenByName, primitiveValue, setUserData, setUserDataINN

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.hl7.fhir.instance.model.api.IAnyResource

    getId, getIdElement, getLanguageElement, getUserData, setId, setUserData

    Methods inherited from interface org.hl7.fhir.instance.model.api.IBase

    getFormatCommentsPost, getFormatCommentsPre, hasFormatComment

    Methods inherited from interface org.hl7.fhir.instance.model.api.IBaseResource

    getMeta, getStructureFhirVersionEnum, isDeleted, setId
  • Field Details

    • LOCAL_PID_TYPE_SYSTEM

      public static final String LOCAL_PID_TYPE_SYSTEM
      See Also:
    • LOCAL_PID_TYPE_VALUE

      public static final String LOCAL_PID_TYPE_VALUE
      See Also:
    • PLACE_OF_BIRTH_URL

      public static final String PLACE_OF_BIRTH_URL
      See Also:
    • PLACE_OF_ORIGIN_URL

      public static final String PLACE_OF_ORIGIN_URL
      See Also:
    • RELIGION_URL

      public static final String RELIGION_URL
      See Also:
    • placeOfBirth

      protected @Nullable org.hl7.fhir.r4.model.Address placeOfBirth
    • placeOfOrigin

      protected @Nullable List<org.hl7.fhir.r4.model.Address> placeOfOrigin
    • citizenship

      protected @Nullable List<PatientCitizenship> citizenship
    • religion

      protected @Nullable org.hl7.fhir.r4.model.CodeableConcept religion
  • Constructor Details

    • ChCorePatient

      public ChCorePatient()
      Empty constructor for the parser.
  • Method Details

    • resolveName

      @ExpectsValidResource public org.hl7.fhir.r4.model.HumanName resolveName()
      Resolves the human name.
      Returns:
      the human name.
      Throws:
      InvalidEmedContentException - if the human name is missing.
    • resolveAddress

      @ExpectsValidResource public @Nullable org.hl7.fhir.r4.model.Address resolveAddress()
      Resolves the address.
      Returns:
      the address or null.
    • resolveGender

      @ExpectsValidResource public org.hl7.fhir.r4.model.Enumerations.AdministrativeGender resolveGender() throws InvalidEmedContentException
      Resolves patient's gender if possible.
      Returns:
      practitioner's gender.
      Throws:
      InvalidEmedContentException - if the gender is not available.
    • resolveReligion

      public @Nullable ReligiousAffiliation resolveReligion()
      Resolves the patient's religion.
      Returns:
      The religion or null.
    • getLocalIds

      public List<org.hl7.fhir.r4.model.Identifier> getLocalIds() throws InvalidEmedContentException
      Resolves the first local patient identifier or throws.
      Returns:
      the first local patient identifier.
      Throws:
      InvalidEmedContentException
    • resolveBirthDate

      Resolves the patient's birthdate or throws.
      Returns:
      the patient's birthdate.
      Throws:
      InvalidEmedContentException - if the patient's birthdate is missing.
    • setReligion

      public ChCorePatient setReligion(ReligiousAffiliation religion)
      Sets patient's religion.
      Parameters:
      religion - Religious Affiliation - the patient's religion.
      Returns:
      this.
    • setBirthDate

      public ChCorePatient setBirthDate(LocalDate birthDate)
      Sets the patient's birthdate.
      Parameters:
      birthDate - the patient's birthdate.
      Returns:
      this.
    • hasReligion

      public boolean hasReligion()
      Returns whether religion code exists.
      Returns:
      true if the religion code exists, false otherwise.
    • hasPlaceOfBirth

      public boolean hasPlaceOfBirth()
      Returns whether religion code exists.
      Returns:
      true if the religion code exists, false otherwise.
    • hasPlaceOfOrigin

      public boolean hasPlaceOfOrigin()
      Returns the place of origin of the patient is specified.
      Returns:
      true if the religion code exists, false otherwise.
    • hasCitizenship

      public boolean hasCitizenship()
      Returns whether the citizenship of the patient is specified.
      Returns:
      true if the religion code exists, false otherwise.
    • addIdentifier

      public org.hl7.fhir.r4.model.Identifier addIdentifier(String system, String value)
      Adds a new local patient identifier.
      Parameters:
      system - The namespace for the identifier value.
      value - The value that is unique.
      Returns:
      the created identifier.
    • resolveLanguageOfCorrespondence

      public @Nullable org.hl7.fhir.r4.model.Patient.PatientCommunicationComponent resolveLanguageOfCorrespondence()
      Resolves the language of correspondence (i.e. preferred communication language) of the patient.
      Returns:
      the preferred patient component with the language of correspondence.
    • resolveEmailAddresses

      public List<@NonNull org.hl7.fhir.r4.model.ContactPoint> resolveEmailAddresses()
      Fetches the list of contact points which are an email address.
      Returns:
      The list of contact points.
    • resolveEmailAddressesAsStrings

      public List<@NonNull String> resolveEmailAddressesAsStrings()
      Fetches the list of email addresses values. It does not check their period.
      Returns:
      The list of email addresses values.
    • resolveEmailAddressesAsStrings

      public List<@NonNull String> resolveEmailAddressesAsStrings(boolean activeOnly)
      Fetches the list of email address values, optionally checking if the period is valid at the moment.
      Parameters:
      activeOnly - If true, the method will filter out email address for which the current timestamp is not within the period boundaries, if defined.
      Returns:
      The list of matching email addresses, as strings.
    • resolvePhoneNumbers

      public List<@NonNull org.hl7.fhir.r4.model.ContactPoint> resolvePhoneNumbers()
      Fetches the list of contact points which are a phone number.
      Returns:
      The list of contact points.
    • resolvePhoneNumbersAsStrings

      public List<@NonNull String> resolvePhoneNumbersAsStrings()
      Fetches the list of phone number values. It does not check their period.
      Returns:
      The list of phone number values as strings.
    • resolvePhoneNumbersAsStrings

      public List<@NonNull String> resolvePhoneNumbersAsStrings(boolean activeOnly)
      Fetches the list of email address values, optionally checking if the period is valid at the moment.
      Parameters:
      activeOnly - If true, the method will filter out phone numbers for which the current timestamp is not within the period boundaries, if defined.
      Returns:
      The list of matching email addresses, as strings.
    • getPlaceOfOrigin

      public List<@NonNull org.hl7.fhir.r4.model.Address> getPlaceOfOrigin()
      Gets the list of places of origin for the patient. The list can be empty.
      Returns:
      The list of places of origin.
    • getCitizenship

      public List<@NonNull PatientCitizenship> getCitizenship()
      Gets the list of citizenships for the patient. The list can be empty.
      Returns:
      The list of citizenships.
    • copy

      public ChCorePatientEpr copy()
      Overrides:
      copy in class org.hl7.fhir.r4.model.Patient
    • copyValues

      public void copyValues(org.hl7.fhir.r4.model.Patient dst)
      Overrides:
      copyValues in class org.hl7.fhir.r4.model.Patient