java.lang.Object
org.projecthusky.communication.xdsmhdconversion.utils.ConverterUtils

public class ConverterUtils extends Object
Utilities for the converter between XDS SubmissionSet and the equivalent MHD resource.
Author:
Ronaldo Loureiro
  • Method Summary

    Modifier and Type
    Method
    Description
    static @Nullable String
    addPrefixOid(@Nullable String urn)
    Add the prefix "urn:oid:"
    static @Nullable String
    addPrefixUuid(@Nullable String urn)
    Add the prefix "urn:uuid:"
    static @Nullable org.hl7.fhir.r4.model.Resource
    findResource(org.hl7.fhir.r4.model.Reference ref, List<org.hl7.fhir.r4.model.Resource> contained)
    search a referenced resource from a list of (contained) resources.
    static @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.LocalizedString
    getLocalizedString(@Nullable String string, @Nullable String languageCode)
    Wrap string in localized string
    static boolean
    isOid(@Nullable String urn)
     
    static @Nullable String
    removePrefixOid(@Nullable String urn)
    Remove the prefix "urn:oid:"
    static @Nullable String
    removePrefixUuid(@Nullable String urn)
    Remove the prefix "urn:uuid:"
    static @Nullable org.hl7.fhir.r4.model.Address
    toAddress(@Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Address address)
    XDS Address -> FHIR Address
    static org.openehealth.ipf.commons.ihe.xds.core.metadata.Address
    toAddress(org.hl7.fhir.r4.model.Address address)
    FHIR Address -> XDS Address
    static @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Author
    toAuthor(@Nullable org.hl7.fhir.r4.model.Reference author, List<org.hl7.fhir.r4.model.Resource> contained, @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable authorRole, @Nullable String languageCode)
    FHIR Reference to Author -> XDS Author
    static @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Code
    toCode(@Nullable List<org.hl7.fhir.r4.model.CodeableConcept> ccs, @Nullable String languageCode)
    FHIR CodeableConcept list -> XDS code
    static @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Code
    toCode(@Nullable org.hl7.fhir.r4.model.CodeableConcept cc, @Nullable String languageCode)
    FHIR CodeableConcept -> XDS Code
    static @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Code
    toCode(@Nullable org.hl7.fhir.r4.model.Coding coding, @Nullable String languageCode)
    FHIR Coding -> XDS Code
    static org.hl7.fhir.r4.model.CodeableConcept
    toCodeableConcept(@Nullable List<org.openehealth.ipf.commons.ihe.xds.core.metadata.Code> codes)
    XDS code list -> FHIR CodeableConcept
    static org.hl7.fhir.r4.model.CodeableConcept
    toCodeableConcept(org.openehealth.ipf.commons.ihe.xds.core.metadata.Code code)
    XDS code -> FHIR CodeableConcept
    static org.hl7.fhir.r4.model.CodeableConcept
    toCodeableConcept(org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable patient)
    XDS Identifiable -> FHIR CodeableConcept
    static @Nullable List<org.openehealth.ipf.commons.ihe.xds.core.metadata.Code>
    toCodes(@Nullable List<org.hl7.fhir.r4.model.CodeableConcept> ccs, @Nullable String languageCode)
     
    static org.hl7.fhir.r4.model.Coding
    toCoding(org.openehealth.ipf.commons.ihe.xds.core.metadata.Code code)
    XDS code -> FHIR Coding
    static org.hl7.fhir.r4.model.ContactPoint
    toContactPoint(org.openehealth.ipf.commons.ihe.xds.core.metadata.Telecom telecom)
    XDS Telecom -> FHIR ContactPoint
    static @Nullable org.hl7.fhir.r4.model.DateTimeType
    toDateTimeType(@Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Timestamp timestamp)
    XDS Timestamp -> FHIR DateTimeType
    static @Nullable org.hl7.fhir.r4.model.DateType
    toDateType(@Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Timestamp timestamp)
    XDS Timestamp -> FHIR DateType
    static @Nullable org.hl7.fhir.r4.model.Organization
    toFHIROrganization(@Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Organization org)
    XDS Organization -> FHIR Organization
    static @Nullable org.hl7.fhir.r4.model.HumanName
    toHumanName(@Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Name<?> name)
    XDS Name -> FHIR HumanName
    static @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable
    toIdentifiable(@Nullable org.hl7.fhir.r4.model.CodeableConcept cc, @Nullable String languageCode)
    FHIR CodeableConcept -> XDS Identifiable
    static org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable
    toIdentifiable(org.hl7.fhir.r4.model.Identifier identifier)
    FHIR Identifier -> XDS Identifiable
    static @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable
    toIdentifiable(org.hl7.fhir.r4.model.Reference reference, List<org.hl7.fhir.r4.model.Resource> resources)
    FHIR Reference -> XDS Identifiable Only for References to Patients or Encounters Identifier is extracted from contained resource or from Reference URL
    static @Nullable org.hl7.fhir.r4.model.Identifier
    toIdentifier(@Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable identifiable)
    XDS Identifiable -> FHIR Identifier
    static List<org.hl7.fhir.r4.model.CodeableConcept>
    toListCodeableConcept(@Nullable List<org.openehealth.ipf.commons.ihe.xds.core.metadata.Code> codes)
    XDS code list -> FHIR CodeableConcept list
    static org.openehealth.ipf.commons.ihe.xds.core.metadata.XpnName
    toName(org.hl7.fhir.r4.model.HumanName name)
    FHIR HumanName -> XDS Name
    static @Nullable org.hl7.fhir.r4.model.Patient
    toPatient(@Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable sourcePatientId, @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.PatientInfo sourcePatientInfo)
    XDS sourcePatientInfo -> FHIR Patient
    static @Nullable org.hl7.fhir.r4.model.Patient
    toPatient(@Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Person person)
    XDS Person -> FHIR Patient
    static @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.PatientInfo
    toPatientInfo(@Nullable org.hl7.fhir.r4.model.Reference ref, @Nullable List<org.hl7.fhir.r4.model.Resource> resources)
    FHIR Reference to Patient -> XDS PatientInfo
    static org.hl7.fhir.r4.model.Reference
    toPatientReference(org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable patient)
    XDS Identifiable -> FHIR Patient Reference
    static @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Person
    toPerson(@Nullable org.hl7.fhir.r4.model.Patient patient)
    FHIR Patient -> XDS Person
    static @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Person
    toPerson(@Nullable org.hl7.fhir.r4.model.Practitioner practitioner)
    FHIR Practitioner -> XDS Person
    static @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Person
    toPerson(@Nullable org.hl7.fhir.r4.model.RelatedPerson related)
    FHIR RelatedPerson -> XDS Person
    static @Nullable org.hl7.fhir.r4.model.Practitioner
    toPractitioner(@Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Person person)
    XDS Person -> FHIR Practitioner
    static org.hl7.fhir.r4.model.Reference
    toReference(org.openehealth.ipf.commons.ihe.xds.core.metadata.Author author)
    XDS Author -> FHIR Reference
    static org.hl7.fhir.r4.model.Reference
    toReference(org.openehealth.ipf.commons.ihe.xds.core.metadata.ReferenceId refId)
    XDS ReferenceId -> FHIR Reference
    static org.openehealth.ipf.commons.ihe.xds.core.metadata.ReferenceId
    toReferenceId(org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable id)
    FHIR Identifiable -> XDS ReferenceId
    static @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Telecom
    toTelecom(@Nullable org.hl7.fhir.r4.model.ContactPoint contactPoint)
    FHIR ContactPoint -> XDS Telecom
    static @Nullable String
    toUriString(org.hl7.fhir.r4.model.Reference ref)
    FHIR Reference -> URI String
    static @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Organization
    toXDSOrganization(@Nullable org.hl7.fhir.r4.model.Organization org)
    FHIR Organization -> XDS Organization

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • addPrefixOid

      public static @Nullable String addPrefixOid(@Nullable String urn)
      Add the prefix "urn:oid:"
      Parameters:
      urn - the oid
      Returns:
      the oid with the prefix "urn:oid:"
    • addPrefixUuid

      public static @Nullable String addPrefixUuid(@Nullable String urn)
      Add the prefix "urn:uuid:"
      Parameters:
      urn - the uuid
      Returns:
      the uuid with the prefix "urn:uuid:"
    • removePrefixOid

      public static @Nullable String removePrefixOid(@Nullable String urn)
      Remove the prefix "urn:oid:"
      Parameters:
      urn - the oid
      Returns:
      the oid without the prefix "urn:oid:"
    • removePrefixUuid

      public static @Nullable String removePrefixUuid(@Nullable String urn)
      Remove the prefix "urn:uuid:"
      Parameters:
      urn - the uuid
      Returns:
      the uuid without the prefix "urn:uuid:"
    • isOid

      public static boolean isOid(@Nullable String urn)
    • findResource

      public static @Nullable org.hl7.fhir.r4.model.Resource findResource(org.hl7.fhir.r4.model.Reference ref, List<org.hl7.fhir.r4.model.Resource> contained)
      search a referenced resource from a list of (contained) resources.
      Parameters:
      ref - the desired reference
      contained - the list of resources
      Returns:
      the resource corresponding to the reference if available
    • getLocalizedString

      public static @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.LocalizedString getLocalizedString(@Nullable String string, @Nullable String languageCode)
      Wrap string in localized string
      Parameters:
      string - string to wrap
      languageCode - language of the resource content
      Returns:
      the localized string
    • toIdentifiable

      public static org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable toIdentifiable(org.hl7.fhir.r4.model.Identifier identifier)
      FHIR Identifier -> XDS Identifiable
      Parameters:
      identifier - FHIR Identifier
      Returns:
      XDS Identifiable
    • toIdentifiable

      public static @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable toIdentifiable(@Nullable org.hl7.fhir.r4.model.CodeableConcept cc, @Nullable String languageCode)
      FHIR CodeableConcept -> XDS Identifiable
      Parameters:
      cc - FHIR CodeableConcept
      Returns:
      XDS Identifiable
    • toIdentifiable

      public static @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable toIdentifiable(org.hl7.fhir.r4.model.Reference reference, List<org.hl7.fhir.r4.model.Resource> resources)
      FHIR Reference -> XDS Identifiable Only for References to Patients or Encounters Identifier is extracted from contained resource or from Reference URL
      Parameters:
      reference - FHIR Reference
      resources - FHIR Resource list
      Returns:
      XDS Identifiable
    • toIdentifier

      public static @Nullable org.hl7.fhir.r4.model.Identifier toIdentifier(@Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable identifiable)
      XDS Identifiable -> FHIR Identifier
      Parameters:
      identifiable - XDS Identifiable
      Returns:
      FHIR Identifier
    • toPatientReference

      public static org.hl7.fhir.r4.model.Reference toPatientReference(org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable patient)
      XDS Identifiable -> FHIR Patient Reference
      Parameters:
      patient - XDS Identifiable
      Returns:
      FHIR Patient Reference
    • toName

      public static org.openehealth.ipf.commons.ihe.xds.core.metadata.XpnName toName(org.hl7.fhir.r4.model.HumanName name)
      FHIR HumanName -> XDS Name
      Parameters:
      name - FHIR HumanName
      Returns:
      XDS Name
    • toPerson

      public static @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Person toPerson(@Nullable org.hl7.fhir.r4.model.Practitioner practitioner)
      FHIR Practitioner -> XDS Person
      Parameters:
      practitioner - FHIR Practitioner
      Returns:
      XDS Person
    • toPerson

      public static @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Person toPerson(@Nullable org.hl7.fhir.r4.model.Patient patient)
      FHIR Patient -> XDS Person
      Parameters:
      patient - FHIR Patient
      Returns:
      XDS Person
    • toPerson

      public static @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Person toPerson(@Nullable org.hl7.fhir.r4.model.RelatedPerson related)
      FHIR RelatedPerson -> XDS Person
      Parameters:
      related - FHIR RelatedPerson
      Returns:
      XDS Person
    • toTelecom

      public static @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Telecom toTelecom(@Nullable org.hl7.fhir.r4.model.ContactPoint contactPoint)
      FHIR ContactPoint -> XDS Telecom
      Parameters:
      contactPoint - FHIR ContactPoint
      Returns:
      XDS Telecom
    • toContactPoint

      public static org.hl7.fhir.r4.model.ContactPoint toContactPoint(org.openehealth.ipf.commons.ihe.xds.core.metadata.Telecom telecom)
      XDS Telecom -> FHIR ContactPoint
      Parameters:
      telecom - XDS Telecom
      Returns:
      FHIR ContactPoint
    • toXDSOrganization

      public static @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Organization toXDSOrganization(@Nullable org.hl7.fhir.r4.model.Organization org)
      FHIR Organization -> XDS Organization
      Parameters:
      org - FHIR Organization
      Returns:
      XDS Organization
    • toFHIROrganization

      public static @Nullable org.hl7.fhir.r4.model.Organization toFHIROrganization(@Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Organization org)
      XDS Organization -> FHIR Organization
      Parameters:
      org - XDS Organization
      Returns:
      FHIR Organization
    • toCode

      public static @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Code toCode(@Nullable org.hl7.fhir.r4.model.Coding coding, @Nullable String languageCode)
      FHIR Coding -> XDS Code
      Parameters:
      coding - FHIR Coding
      languageCode - the language of the resource content
      Returns:
      XDS Code
    • toCode

      public static @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Code toCode(@Nullable org.hl7.fhir.r4.model.CodeableConcept cc, @Nullable String languageCode)
      FHIR CodeableConcept -> XDS Code
      Parameters:
      cc - FHIR CodeableConcept
      languageCode - the language of the resource content
      Returns:
      XDS Code
    • toCode

      public static @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Code toCode(@Nullable List<org.hl7.fhir.r4.model.CodeableConcept> ccs, @Nullable String languageCode)
      FHIR CodeableConcept list -> XDS code
      Parameters:
      ccs - FHIR CodeableConcept list
      Returns:
      XDS code
    • toCodes

      public static @Nullable List<org.openehealth.ipf.commons.ihe.xds.core.metadata.Code> toCodes(@Nullable List<org.hl7.fhir.r4.model.CodeableConcept> ccs, @Nullable String languageCode)
    • toCoding

      public static org.hl7.fhir.r4.model.Coding toCoding(org.openehealth.ipf.commons.ihe.xds.core.metadata.Code code)
      XDS code -> FHIR Coding
      Parameters:
      code - XDS code
      Returns:
      FHIR CodeableConcept
    • toCodeableConcept

      public static org.hl7.fhir.r4.model.CodeableConcept toCodeableConcept(org.openehealth.ipf.commons.ihe.xds.core.metadata.Code code)
      XDS code -> FHIR CodeableConcept
      Parameters:
      code - XDS code
      Returns:
      FHIR CodeableConcept
    • toCodeableConcept

      public static org.hl7.fhir.r4.model.CodeableConcept toCodeableConcept(@Nullable List<org.openehealth.ipf.commons.ihe.xds.core.metadata.Code> codes)
      XDS code list -> FHIR CodeableConcept
      Parameters:
      codes - XDS code list
      Returns:
      FHIR CodeableConcept
    • toCodeableConcept

      public static org.hl7.fhir.r4.model.CodeableConcept toCodeableConcept(org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable patient)
      XDS Identifiable -> FHIR CodeableConcept
      Parameters:
      patient - XDS Identifiable
      Returns:
      FHIR CodeableConcept
    • toListCodeableConcept

      public static List<org.hl7.fhir.r4.model.CodeableConcept> toListCodeableConcept(@Nullable List<org.openehealth.ipf.commons.ihe.xds.core.metadata.Code> codes)
      XDS code list -> FHIR CodeableConcept list
      Parameters:
      codes - XDS code list
      Returns:
      FHIR CodeableConcept list
    • toAuthor

      public static @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Author toAuthor(@Nullable org.hl7.fhir.r4.model.Reference author, List<org.hl7.fhir.r4.model.Resource> contained, @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable authorRole, @Nullable String languageCode)
      FHIR Reference to Author -> XDS Author
      Parameters:
      author - the author's reference
      contained - the list of resources
      authorRole - the id of the author's role
      languageCode - language of the resource content
      Returns:
      the author
    • toHumanName

      public static @Nullable org.hl7.fhir.r4.model.HumanName toHumanName(@Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Name<?> name)
      XDS Name -> FHIR HumanName
      Parameters:
      name - XDS Name
      Returns:
      FHIR HumanName
    • toPatient

      public static @Nullable org.hl7.fhir.r4.model.Patient toPatient(@Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Person person)
      XDS Person -> FHIR Patient
      Parameters:
      person - XDS Person
      Returns:
      FHIR Patient
    • toPatient

      public static @Nullable org.hl7.fhir.r4.model.Patient toPatient(@Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable sourcePatientId, @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.PatientInfo sourcePatientInfo)
      XDS sourcePatientInfo -> FHIR Patient
      Parameters:
      sourcePatientId - XDS Identifiable
      sourcePatientInfo - XDS PatientInfo
      Returns:
      FHIR Patient
    • toPatientInfo

      public static @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.PatientInfo toPatientInfo(@Nullable org.hl7.fhir.r4.model.Reference ref, @Nullable List<org.hl7.fhir.r4.model.Resource> resources)
      FHIR Reference to Patient -> XDS PatientInfo
      Parameters:
      ref - FHIR Reference to Patient
      resources - FHIR Resource list
      Returns:
      XDS PatientInfo
    • toPractitioner

      public static @Nullable org.hl7.fhir.r4.model.Practitioner toPractitioner(@Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Person person)
      XDS Person -> FHIR Practitioner
      Parameters:
      person - XDS Person
      Returns:
      FHIR Practitioner
    • toReference

      public static org.hl7.fhir.r4.model.Reference toReference(org.openehealth.ipf.commons.ihe.xds.core.metadata.Author author)
      XDS Author -> FHIR Reference
      Parameters:
      author - XDS Author
      Returns:
      FHIR Reference
    • toReference

      public static org.hl7.fhir.r4.model.Reference toReference(org.openehealth.ipf.commons.ihe.xds.core.metadata.ReferenceId refId)
      XDS ReferenceId -> FHIR Reference
      Parameters:
      refId - XDS ReferenceId
      Returns:
      FHIR Reference
    • toReferenceId

      public static org.openehealth.ipf.commons.ihe.xds.core.metadata.ReferenceId toReferenceId(org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable id)
      FHIR Identifiable -> XDS ReferenceId
      Parameters:
      id - FHIR Identifiable
      Returns:
      XDS ReferenceId
    • toDateTimeType

      public static @Nullable org.hl7.fhir.r4.model.DateTimeType toDateTimeType(@Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Timestamp timestamp)
      XDS Timestamp -> FHIR DateTimeType
      Parameters:
      timestamp - XDS Timestamp
      Returns:
      FHIR DateTimeType
    • toDateType

      public static @Nullable org.hl7.fhir.r4.model.DateType toDateType(@Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Timestamp timestamp)
      XDS Timestamp -> FHIR DateType
      Parameters:
      timestamp - XDS Timestamp
      Returns:
      FHIR DateType
    • toAddress

      public static @Nullable org.hl7.fhir.r4.model.Address toAddress(@Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Address address)
      XDS Address -> FHIR Address
      Parameters:
      address - XDS Address
      Returns:
      FHIR Address
    • toAddress

      public static org.openehealth.ipf.commons.ihe.xds.core.metadata.Address toAddress(org.hl7.fhir.r4.model.Address address)
      FHIR Address -> XDS Address
      Parameters:
      address - FHIR Address
      Returns:
      XDS Address
    • toUriString

      public static @Nullable String toUriString(org.hl7.fhir.r4.model.Reference ref)
      FHIR Reference -> URI String
      Parameters:
      ref - FHIR Reference
      Returns:
      URI String