use of org.hl7.fhir.dstu3.model.ListResource in project org.hl7.fhir.core by hapifhir.
the class CCDAConverter method processVitalSignsSection.
protected SectionComponent processVitalSignsSection(Element section) throws Exception {
ListResource list = new ListResource();
for (Element entry : cda.getChildren(section, "entry")) {
Element organizer = cda.getlastChild(entry);
if (cda.hasTemplateId(organizer, "2.16.840.1.113883.10.20.22.4.26")) {
processVitalSignsOrganizer(list, organizer);
} else
throw new Exception("Unhandled Section template ids: " + cda.showTemplateIds(organizer));
}
// todo: text
SectionComponent s = new Composition.SectionComponent();
s.setCode(convert.makeCodeableConceptFromCD(cda.getChild(section, "code")));
// todo: check subject
s.addEntry(Factory.makeReference(addReference(list, "Vital Signs", makeUUIDReference())));
return s;
}
use of org.hl7.fhir.dstu3.model.ListResource in project org.hl7.fhir.core by hapifhir.
the class CCDAConverter method processVitalSignsOrganizer.
protected void processVitalSignsOrganizer(ListResource list, Element organizer) throws Exception {
cda.checkTemplateId(organizer, "2.16.840.1.113883.10.20.22.4.26");
checkNoNegationOrNullFlavor(organizer, "Vital Signs Organizer");
checkNoSubject(organizer, "Vital Signs Organizer");
// moodCode is EVN.
Observation obs = new Observation();
addItemToList(list, obs);
// SHALL contain at least one [1..*] id (CONF:7282).
for (Element e : cda.getChildren(organizer, "id")) obs.getIdentifier().add(convert.makeIdentifierFromII(e));
// SHALL contain exactly one [1..1] code (CONF:19176).
// This code SHALL contain exactly one [1..1] @code="46680005" Vital signs (CodeSystem: SNOMED-CT 2.16.840.1.113883.6.96 STATIC) (CONF:19177).
obs.setCode(convert.makeCodeableConceptFromCD(cda.getChild(organizer, "code")));
// SHALL contain exactly one [1..1] effectiveTime (CONF:7288).
obs.setEffective(convert.makeMatchingTypeFromIVL(cda.getChild(organizer, "effectiveTime")));
// SHALL contain exactly one [1..1] Vital Sign Observation (templateId:2.16.840.1.113883.10.20.22.4.27) (CONF:15946).
for (Element e : cda.getChildren(organizer, "component")) {
ObservationRelatedComponent ro = new ObservationRelatedComponent();
ro.setType(ObservationRelationshipType.HASMEMBER);
ro.setTarget(Factory.makeReference("#" + processVitalSignsObservation(e, list)));
}
}
use of org.hl7.fhir.dstu3.model.ListResource in project org.hl7.fhir.core by hapifhir.
the class CCDAConverter method processAdverseReactionsSection.
protected SectionComponent processAdverseReactionsSection(Element section) throws Exception {
ListResource list = new ListResource();
for (Element entry : cda.getChildren(section, "entry")) {
Element concern = cda.getChild(entry, "act");
if (cda.hasTemplateId(concern, "2.16.840.1.113883.10.20.22.4.30")) {
processAllergyProblemAct(list, concern);
} else
throw new Exception("Unhandled Section template ids: " + cda.showTemplateIds(concern));
}
// todo: text
SectionComponent s = new Composition.SectionComponent();
s.setCode(convert.makeCodeableConceptFromCD(cda.getChild(section, "code")));
// todo: check subject
s.addEntry(Factory.makeReference(addReference(list, "Allergies, Adverse Reactions, Alerts", makeUUIDReference())));
return s;
}
use of org.hl7.fhir.dstu3.model.ListResource in project nia-patient-switching-standard-adaptor by NHSDigital.
the class EncounterMapper method generateStructuredConsultation.
private void generateStructuredConsultation(List<RCMRMT030101UK04CompoundStatement> topicCompoundStatementList, RCMRMT030101UK04EhrComposition ehrComposition, ListResource consultation, List<ListResource> topics, List<ListResource> categories) {
topicCompoundStatementList.forEach(topicCompoundStatement -> {
var topic = consultationListMapper.mapToTopic(consultation, topicCompoundStatement);
consultation.addEntry(new ListEntryComponent(new Reference(topic)));
generateCategoryLists(topicCompoundStatement, topic, categories);
generateLinkSetTopicLists(ehrComposition, consultation, topics);
topics.add(topic);
});
}
use of org.hl7.fhir.dstu3.model.ListResource in project nia-patient-switching-standard-adaptor by NHSDigital.
the class EncounterMapper method generateFlatConsultation.
private void generateFlatConsultation(ListResource consultation, List<ListResource> topics, RCMRMT030101UK04EhrComposition ehrComposition) {
var topic = consultationListMapper.mapToTopic(consultation, null);
List<Reference> entryReferences = new ArrayList<>();
resourceReferenceUtil.extractChildReferencesFromEhrComposition(ehrComposition, entryReferences);
entryReferences.forEach(reference -> addEntry(topic, reference));
consultation.addEntry(new ListEntryComponent(new Reference(topic)));
topics.add(topic);
}
Aggregations