@Test public void testProcessor() throws Exception { Map<String, String> expectedAttributes = new HashMap<String, String>(); expectedAttributes.put("code.code", "34133-9"); expectedAttributes.put("code.codeSystem", "2.16.840.1.113883.6.1"); expectedAttributes.put("code.codeSystemName", "LOINC"); expectedAttributes.put("code.displayName", "Summarization of Episode Note"); expectedAttributes.put("problemSection.code.code", "11450-4"); expectedAttributes.put("problemSection.code.codeSystem", "2.16.840.1.113883.6.1"); expectedAttributes.put("problemSection.code.codeSystemName", "LOINC"); expectedAttributes.put("problemSection.code.displayName", "Problem List"); expectedAttributes.put("problemSection.act.code.code", "CONC"); expectedAttributes.put("problemSection.act.code.codeSystem", "2.16.840.1.113883.5.6"); expectedAttributes.put("problemSection.act.code.codeSystemName", "HL7ActClass"); expectedAttributes.put("problemSection.act.code.displayName", "Concern"); expectedAttributes.put("problemSection.act.observation.problemStatus.code.code", "33999-4"); expectedAttributes.put("problemSection.act.observation.problemStatus.code.codeSystem", "2.16.840.1.113883.6.1"); expectedAttributes.put("problemSection.act.observation.problemStatus.code.codeSystemName", "LOINC"); expectedAttributes.put("problemSection.act.observation.problemStatus.code.displayName", "Status"); expectedAttributes.put("problemSection.act.observation.problemStatus.statusCode.code", "completed"); expectedAttributes.put("problemSection.act.observation.statusCode.code", "completed"); expectedAttributes.put("vitalSignsSection.code.code", "8716-3"); expectedAttributes.put("vitalSignsSection.code.codeSystem", "2.16.840.1.113883.6.1"); expectedAttributes.put("vitalSignsSection.code.codeSystemName", "LOINC"); expectedAttributes.put("vitalSignsSection.code.displayName", "Vital Signs"); expectedAttributes.put("vitalSignsSection.organizer.code.code", "46680005"); expectedAttributes.put("vitalSignsSection.organizer.code.codeSystem", "2.16.840.1.113883.6.96"); expectedAttributes.put("vitalSignsSection.organizer.code.codeSystemName", "SNOMEDCT"); expectedAttributes.put("vitalSignsSection.organizer.code.displayName", "Vital signs"); expectedAttributes.put("vitalSignsSection.organizer.statusCode.code", "completed"); expectedAttributes.put("vitalSignsSection.organizer.observations.code.codeSystem", "2.16.840.1.113883.6.1"); expectedAttributes.put("vitalSignsSection.organizer.observations.code.codeSystemName", "LOINC"); expectedAttributes.put("vitalSignsSection.organizer.observations.statusCode.code", "completed"); ContinuityOfCareDocument doc = ConsolFactory.eINSTANCE.createContinuityOfCareDocument().init(); ProblemConcernAct problemAct = ConsolFactory.eINSTANCE.createProblemConcernAct().init(); ProblemObservation problemObservation = ConsolFactory.eINSTANCE.createProblemObservation().init(); ProblemStatus problemStatus = ConsolFactory.eINSTANCE.createProblemStatus().init(); ProblemSection problemSection = ConsolFactory.eINSTANCE.createProblemSection().init(); doc.addSection(problemSection); problemSection.addAct(problemAct); problemAct.addObservation(problemObservation); problemObservation.addObservation(problemStatus); VitalSignsOrganizer vitalSignsOrganizer = ConsolFactory.eINSTANCE.createVitalSignsOrganizer().init(); VitalSignObservation vitalSignObservation = ConsolFactory.eINSTANCE.createVitalSignObservation().init(); VitalSignsSection vitalSignsSection = ConsolFactory.eINSTANCE.createVitalSignsSection().init(); doc.addSection(vitalSignsSection); vitalSignsSection.addOrganizer(vitalSignsOrganizer); vitalSignsOrganizer.addObservation(vitalSignObservation); StringWriter writer = new StringWriter(); CDAUtil.save(doc, writer); runTests(writer.toString(), expectedAttributes, true, true); }
@Override protected void init(final ProcessorInitializationContext context) { final Set<Relationship> _relationships = new HashSet<>(); _relationships.add(REL_SUCCESS); _relationships.add(REL_FAILURE); this.relationships = Collections.unmodifiableSet(_relationships); final List<PropertyDescriptor> _properties = new ArrayList<>(); _properties.add(SKIP_VALIDATION); this.properties = Collections.unmodifiableList(_properties); }
ExtractCCDAAttributes extends AbstractProcessor { @Override protected void init(final ProcessorInitializationContext context) { final Set<Relationship> _relationships = new HashSet<>(); _relationships.add(REL_SUCCESS); _relationships.add(REL_FAILURE); this.relationships = Collections.unmodifiableSet(_relationships); final List<PropertyDescriptor> _properties = new ArrayList<>(); _properties.add(SKIP_VALIDATION); this.properties = Collections.unmodifiableList(_properties); } }
ExtractCCDAAttributes extends AbstractProcessor { @Override protected void init(final ProcessorInitializationContext context) { final Set<Relationship> _relationships = new HashSet<>(); _relationships.add(REL_SUCCESS); _relationships.add(REL_FAILURE); this.relationships = Collections.unmodifiableSet(_relationships); final List<PropertyDescriptor> _properties = new ArrayList<>(); _properties.add(SKIP_VALIDATION); this.properties = Collections.unmodifiableList(_properties); }  }
ExtractCCDAAttributes extends AbstractProcessor { @Override protected void init(final ProcessorInitializationContext context) { final Set<Relationship> _relationships = new HashSet<>(); _relationships.add(REL_SUCCESS); _relationships.add(REL_FAILURE); this.relationships = Collections.unmodifiableSet(_relationships); final List<PropertyDescriptor> _properties = new ArrayList<>(); _properties.add(SKIP_VALIDATION); this.properties = Collections.unmodifiableList(_properties); }  @Override Set<Relationship> getRelationships(); @OnScheduled void onScheduled(final ProcessContext context); @Override void onTrigger(final ProcessContext context, final ProcessSession session); }
ExtractCCDAAttributes extends AbstractProcessor { @Override protected void init(final ProcessorInitializationContext context) { final Set<Relationship> _relationships = new HashSet<>(); _relationships.add(REL_SUCCESS); _relationships.add(REL_FAILURE); this.relationships = Collections.unmodifiableSet(_relationships); final List<PropertyDescriptor> _properties = new ArrayList<>(); _properties.add(SKIP_VALIDATION); this.properties = Collections.unmodifiableList(_properties); }  @Override Set<Relationship> getRelationships(); @OnScheduled void onScheduled(final ProcessContext context); @Override void onTrigger(final ProcessContext context, final ProcessSession session); static final PropertyDescriptor SKIP_VALIDATION; static final Relationship REL_SUCCESS; static final Relationship REL_FAILURE; }