Class ConverterUtils
java.lang.Object
org.projecthusky.communication.xdsmhdconversion.utils.ConverterUtils
Utilities for the converter between XDS SubmissionSet and the equivalent MHD resource.
- Author:
- Ronaldo Loureiro
-
Method Summary
Modifier and TypeMethodDescriptionstatic @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 stringstatic boolean
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 Addressstatic org.openehealth.ipf.commons.ihe.xds.core.metadata.Address
toAddress
(org.hl7.fhir.r4.model.Address address) FHIR Address -> XDS Addressstatic @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 Authorstatic @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Code
FHIR CodeableConcept list -> XDS codestatic @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Code
FHIR CodeableConcept -> XDS Codestatic @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Code
FHIR Coding -> XDS Codestatic org.hl7.fhir.r4.model.CodeableConcept
toCodeableConcept
(@Nullable List<org.openehealth.ipf.commons.ihe.xds.core.metadata.Code> codes) XDS code list -> FHIR CodeableConceptstatic org.hl7.fhir.r4.model.CodeableConcept
toCodeableConcept
(org.openehealth.ipf.commons.ihe.xds.core.metadata.Code code) XDS code -> FHIR CodeableConceptstatic org.hl7.fhir.r4.model.CodeableConcept
toCodeableConcept
(org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable patient) XDS Identifiable -> FHIR CodeableConceptstatic @Nullable List<org.openehealth.ipf.commons.ihe.xds.core.metadata.Code>
static org.hl7.fhir.r4.model.Coding
toCoding
(org.openehealth.ipf.commons.ihe.xds.core.metadata.Code code) XDS code -> FHIR Codingstatic org.hl7.fhir.r4.model.ContactPoint
toContactPoint
(org.openehealth.ipf.commons.ihe.xds.core.metadata.Telecom telecom) XDS Telecom -> FHIR ContactPointstatic @Nullable org.hl7.fhir.r4.model.DateTimeType
toDateTimeType
(@Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Timestamp timestamp) XDS Timestamp -> FHIR DateTimeTypestatic @Nullable org.hl7.fhir.r4.model.DateType
toDateType
(@Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Timestamp timestamp) XDS Timestamp -> FHIR DateTypestatic @Nullable org.hl7.fhir.r4.model.Organization
toFHIROrganization
(@Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Organization org) XDS Organization -> FHIR Organizationstatic @Nullable org.hl7.fhir.r4.model.HumanName
toHumanName
(@Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Name<?> name) XDS Name -> FHIR HumanNamestatic @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 Identifiablestatic org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable
toIdentifiable
(org.hl7.fhir.r4.model.Identifier identifier) FHIR Identifier -> XDS Identifiablestatic @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 URLstatic @Nullable org.hl7.fhir.r4.model.Identifier
toIdentifier
(@Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable identifiable) XDS Identifiable -> FHIR Identifierstatic 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 liststatic org.openehealth.ipf.commons.ihe.xds.core.metadata.XpnName
toName
(org.hl7.fhir.r4.model.HumanName name) FHIR HumanName -> XDS Namestatic @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 Patientstatic @Nullable org.hl7.fhir.r4.model.Patient
toPatient
(@Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Person person) XDS Person -> FHIR Patientstatic @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 PatientInfostatic org.hl7.fhir.r4.model.Reference
toPatientReference
(org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable patient) XDS Identifiable -> FHIR Patient Referencestatic @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Person
toPerson
(@Nullable org.hl7.fhir.r4.model.Patient patient) FHIR Patient -> XDS Personstatic @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Person
toPerson
(@Nullable org.hl7.fhir.r4.model.Practitioner practitioner) FHIR Practitioner -> XDS Personstatic @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Person
toPerson
(@Nullable org.hl7.fhir.r4.model.RelatedPerson related) FHIR RelatedPerson -> XDS Personstatic @Nullable org.hl7.fhir.r4.model.Practitioner
toPractitioner
(@Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Person person) XDS Person -> FHIR Practitionerstatic org.hl7.fhir.r4.model.Reference
toReference
(org.openehealth.ipf.commons.ihe.xds.core.metadata.Author author) XDS Author -> FHIR Referencestatic org.hl7.fhir.r4.model.Reference
toReference
(org.openehealth.ipf.commons.ihe.xds.core.metadata.ReferenceId refId) XDS ReferenceId -> FHIR Referencestatic org.openehealth.ipf.commons.ihe.xds.core.metadata.ReferenceId
toReferenceId
(org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable id) FHIR Identifiable -> XDS ReferenceIdstatic @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Telecom
toTelecom
(@Nullable org.hl7.fhir.r4.model.ContactPoint contactPoint) FHIR ContactPoint -> XDS Telecomstatic @Nullable String
toUriString
(org.hl7.fhir.r4.model.Reference ref) FHIR Reference -> URI Stringstatic @Nullable org.openehealth.ipf.commons.ihe.xds.core.metadata.Organization
toXDSOrganization
(@Nullable org.hl7.fhir.r4.model.Organization org) FHIR Organization -> XDS Organization
-
Method Details
-
addPrefixOid
Add the prefix "urn:oid:"- Parameters:
urn
- the oid- Returns:
- the oid with the prefix "urn:oid:"
-
addPrefixUuid
Add the prefix "urn:uuid:"- Parameters:
urn
- the uuid- Returns:
- the uuid with the prefix "urn:uuid:"
-
removePrefixOid
Remove the prefix "urn:oid:"- Parameters:
urn
- the oid- Returns:
- the oid without the prefix "urn:oid:"
-
removePrefixUuid
Remove the prefix "urn:uuid:"- Parameters:
urn
- the uuid- Returns:
- the uuid without the prefix "urn:uuid:"
-
isOid
-
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 referencecontained
- 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 wraplanguageCode
- 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 Referenceresources
- 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 CodinglanguageCode
- 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 CodeableConceptlanguageCode
- 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
-
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 referencecontained
- the list of resourcesauthorRole
- the id of the author's rolelanguageCode
- 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 IdentifiablesourcePatientInfo
- 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 Patientresources
- 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
FHIR Reference -> URI String- Parameters:
ref
- FHIR Reference- Returns:
- URI String
-