From a0b4c1eca771a426ace9a7cf05f5ce08ed1f4d42 Mon Sep 17 00:00:00 2001 From: Samuel Aquino Date: Wed, 4 Oct 2023 14:52:13 -0500 Subject: [PATCH] Add subgroup decoding, program, entity type and test coverage --- .../decode/ClinicalDocumentDecoder.java | 29 +++- .../gov/cms/qpp/conversion/model/Program.java | 2 +- .../resources/pathing/path-correlation.json | 2 +- .../decode/ClinicalDocumentDecoderTest.java | 156 ++++++++++++++---- 4 files changed, 150 insertions(+), 39 deletions(-) diff --git a/converter/src/main/java/gov/cms/qpp/conversion/decode/ClinicalDocumentDecoder.java b/converter/src/main/java/gov/cms/qpp/conversion/decode/ClinicalDocumentDecoder.java index 14e1a6f43..defd643c7 100644 --- a/converter/src/main/java/gov/cms/qpp/conversion/decode/ClinicalDocumentDecoder.java +++ b/converter/src/main/java/gov/cms/qpp/conversion/decode/ClinicalDocumentDecoder.java @@ -47,7 +47,7 @@ public class ClinicalDocumentDecoder extends QrdaDecoder { public static final String ENTITY_APM = "apm"; static final String ENTITY_GROUP = "group"; static final String ENTITY_INDIVIDUAL = "individual"; - static final String ENTITY_SUBGROUP = "subgroup"; + public static final String ENTITY_SUBGROUP = "subgroup"; public static final String ENTITY_VIRTUAL_GROUP = "virtualGroup"; public static final String APP_PROGRAM_NAME = "app1"; public static final String MIPS = "MIPS"; @@ -57,8 +57,8 @@ public class ClinicalDocumentDecoder extends QrdaDecoder { public static final String PCF = "PCF"; public static final String APP = "APP"; public static final String CPCPLUS = "CPCPLUS"; - private static final String MIPS_GROUP = "MIPS_GROUP"; - private static final String MIPS_INDIVIDUAL = "MIPS_INDIV"; + public static final String MIPS_GROUP = "MIPS_GROUP"; + public static final String MIPS_INDIVIDUAL = "MIPS_INDIV"; public static final String MIPS_APM = "MIPS_APMENTITY"; public static final String MIPS_VIRTUAL_GROUP = "MIPS_VIRTUALGROUP"; public static final String MIPS_SUBGROUP = "MIPS_SUBGROUP"; @@ -82,9 +82,12 @@ protected DecodeResult decode(Element element, Node thisNode) { setProgramNameOnNode(element, thisNode); setPracticeSiteAddress(element, thisNode); setCehrtOnNode(element, thisNode); - String entityType = thisNode.getValue(ENTITY_TYPE); + String entityType = thisNode.getValueOrDefault(ENTITY_TYPE, ""); if (MVP_ENTITIES.contains(entityType) && Program.isMips(thisNode)) { - setMvpIdOnNode(element, thisNode); + setValueOnNode(element, thisNode, MVP_ID); + if (ENTITY_SUBGROUP.equalsIgnoreCase(entityType)) { + setValueOnNode(element, thisNode, SUBGROUP_ID); + } } if (ENTITY_APM.equalsIgnoreCase(entityType)) { setEntityIdOnNode(element, thisNode); @@ -157,9 +160,15 @@ private void setMvpIdOnNode(Element element, Node thisNode) { setOnNode(element, getXpath(MVP_ID), consumer, Filters.attribute(), true); } - private void setSubgroupIdOnNode(Element element, Node thisNode, String entityLocationId) { - Consumer consumer = p -> thisNode.putValue(SUBGROUP_ID, p.getValue()); - setOnNode(element, getXpath(entityLocationId), consumer, Filters.attribute(), true); + /** + * Sets a specific value as an element on the Node class decoder + * @param element current xml element to find the value via xpath + * @param thisNode current node + * @param currentValue to be added to the Node + */ + private void setValueOnNode(Element element, Node thisNode, String currentValue) { + Consumer consumer = p -> thisNode.putValue(currentValue, p.getValue()); + setOnNode(element, getXpath(currentValue), consumer, Filters.attribute(), true); } /** @@ -279,6 +288,10 @@ private Pair getProgramNameEntityPair(String name) { pair = new ImmutablePair<>(PCF_PROGRAM_NAME, ENTITY_APM); break; + case MIPS_SUBGROUP: + pair = new ImmutablePair<>(MIPS_PROGRAM_NAME, ENTITY_SUBGROUP); + break; + default: pair = new ImmutablePair<>(name.toLowerCase(Locale.ENGLISH), ENTITY_INDIVIDUAL); break; diff --git a/converter/src/main/java/gov/cms/qpp/conversion/model/Program.java b/converter/src/main/java/gov/cms/qpp/conversion/model/Program.java index 925e98b42..3e7adf54c 100644 --- a/converter/src/main/java/gov/cms/qpp/conversion/model/Program.java +++ b/converter/src/main/java/gov/cms/qpp/conversion/model/Program.java @@ -13,7 +13,7 @@ * Construct that helps categorize submissions by program name. */ public enum Program { - MIPS("MIPS_GROUP", "MIPS_INDIV", "MIPS_VIRTUALGROUP", "MIPS", "MIPS_APMENTITY"), + MIPS("MIPS_GROUP", "MIPS_INDIV", "MIPS_VIRTUALGROUP", "MIPS", "MIPS_APMENTITY", "MIPS_SUBGROUP"), PCF("PCF"), APP("MIPS_APP1_INDIV", "MIPS_APP1_GROUP", "MIPS_APP1_APMENTITY"), ALL; diff --git a/converter/src/main/resources/pathing/path-correlation.json b/converter/src/main/resources/pathing/path-correlation.json index 12e152c92..fb9dc05f9 100644 --- a/converter/src/main/resources/pathing/path-correlation.json +++ b/converter/src/main/resources/pathing/path-correlation.json @@ -187,7 +187,7 @@ "subgroupId" ], "goods": { - "relativeXPath": "./*[local-name() = 'documentationOf' and namespace-uri() = '']/*[local-name() = 'serviceEvent' and namespace-uri() = '']/*[local-name() = 'performer' and namespace-uri() = '']/*[local-name() = 'assignedEntity' and namespace-uri() = '']/*[local-name() = 'representedOrganization' and namespace-uri() = '']/*[local-name() = 'id' and namespace-uri() = ''][@root='2.16.840.1.113883.4.2']/@extension", + "relativeXPath": "./*[local-name() = 'documentationOf' and namespace-uri() = '']/*[local-name() = 'serviceEvent' and namespace-uri() = '']/*[local-name() = 'performer' and namespace-uri() = '']/*[local-name() = 'assignedEntity' and namespace-uri() = '']/*[local-name() = 'representedOrganization' and namespace-uri() = '']/*[local-name() = 'id' and namespace-uri() = ''][@root='2.16.840.1.113883.3.249.5.5']/@extension", "xmltype": "attribute" } } diff --git a/converter/src/test/java/gov/cms/qpp/conversion/decode/ClinicalDocumentDecoderTest.java b/converter/src/test/java/gov/cms/qpp/conversion/decode/ClinicalDocumentDecoderTest.java index db885053b..931ffd76e 100644 --- a/converter/src/test/java/gov/cms/qpp/conversion/decode/ClinicalDocumentDecoderTest.java +++ b/converter/src/test/java/gov/cms/qpp/conversion/decode/ClinicalDocumentDecoderTest.java @@ -33,6 +33,7 @@ class ClinicalDocumentDecoderTest { private static final String TEST_TIN = "123456789"; private static final String TEST_NPI = "2567891421"; private static final String TEST_MVP_ID = "MVP01123"; + private static final String TEST_SUBGROUP_ID = "SG-00000001"; @BeforeAll static void init() throws IOException { @@ -148,7 +149,7 @@ void testIaMeasurePerformed() { @Test void decodeClinicalDocumentInternalDecode() { - Element clinicalDocument = makeClinicalDocument("MIPS"); + Element clinicalDocument = makeClinicalDocument("MIPS", false, false); Node testParentNode = new Node(); ClinicalDocumentDecoder objectUnderTest = new ClinicalDocumentDecoder(new Context()); objectUnderTest.setNamespace(clinicalDocument.getNamespace()); @@ -170,7 +171,7 @@ void decodeClinicalDocumentInternalDecode() { @Test void decodeAppClinicalDocumentInternalDecode() { - Element clinicalDocument = makeClinicalDocument("APP1"); + Element clinicalDocument = makeClinicalDocument("APP1", false, false); Node testParentNode = new Node(); ClinicalDocumentDecoder objectUnderTest = new ClinicalDocumentDecoder(new Context()); objectUnderTest.setNamespace(clinicalDocument.getNamespace()); @@ -192,7 +193,7 @@ void decodeAppClinicalDocumentInternalDecode() { @Test void decodeClinicalDocumentInternalDecodeMIPSIndividual() { - Element clinicalDocument = makeClinicalDocument("MIPS_INDIV"); + Element clinicalDocument = makeClinicalDocument("MIPS_INDIV", false, false); Node testParentNode = new Node(); ClinicalDocumentDecoder objectUnderTest = new ClinicalDocumentDecoder(new Context()); objectUnderTest.setNamespace(clinicalDocument.getNamespace()); @@ -214,7 +215,7 @@ void decodeClinicalDocumentInternalDecodeMIPSIndividual() { @Test void decodeClinicalDocumentInternalDecodeMIPSAPPIndividual() { - Element clinicalDocument = makeClinicalDocument("MIPS_APP1_INDIV"); + Element clinicalDocument = makeClinicalDocument("MIPS_APP1_INDIV", false, false); Node testParentNode = new Node(); ClinicalDocumentDecoder objectUnderTest = new ClinicalDocumentDecoder(new Context()); objectUnderTest.setNamespace(clinicalDocument.getNamespace()); @@ -236,7 +237,7 @@ void decodeClinicalDocumentInternalDecodeMIPSAPPIndividual() { @Test void decodeClinicalDocumentInternalDecodeMIPSGroup() { - Element clinicalDocument = makeClinicalDocument("MIPS_GROUP"); + Element clinicalDocument = makeClinicalDocument("MIPS_GROUP", false, false); Node testParentNode = new Node(); ClinicalDocumentDecoder objectUnderTest = new ClinicalDocumentDecoder(new Context()); objectUnderTest.setNamespace(clinicalDocument.getNamespace()); @@ -258,7 +259,7 @@ void decodeClinicalDocumentInternalDecodeMIPSGroup() { @Test void decodeClinicalDocumentInternalDecodeMIPSAPPGroup() { - Element clinicalDocument = makeClinicalDocument("MIPS_APP1_GROUP"); + Element clinicalDocument = makeClinicalDocument("MIPS_APP1_GROUP", false, false); Node testParentNode = new Node(); ClinicalDocumentDecoder objectUnderTest = new ClinicalDocumentDecoder(new Context()); objectUnderTest.setNamespace(clinicalDocument.getNamespace()); @@ -280,7 +281,7 @@ void decodeClinicalDocumentInternalDecodeMIPSAPPGroup() { @Test void decodeClinicalDocumentInternalDecodeUnknown() { - Element clinicalDocument = makeClinicalDocument("Unknown"); + Element clinicalDocument = makeClinicalDocument("Unknown", false, false); Node testParentNode = new Node(); ClinicalDocumentDecoder objectUnderTest = new ClinicalDocumentDecoder(new Context()); objectUnderTest.setNamespace(clinicalDocument.getNamespace()); @@ -302,8 +303,8 @@ void decodeClinicalDocumentInternalDecodeUnknown() { @Test void decodePcfPracticeSiteAddressTest() { - Element clinicalDocument = makeClinicalDocument(ClinicalDocumentDecoder.PCF_PROGRAM_NAME); - clinicalDocument.addContent(prepareParticipant(clinicalDocument.getNamespace(), CPC_PRACTICE_ROOT)); + Element clinicalDocument = makeClinicalDocument(ClinicalDocumentDecoder.PCF_PROGRAM_NAME, false, false); + clinicalDocument.addContent(prepareParticipant(clinicalDocument.getNamespace(), CPC_PRACTICE_ROOT, ENTITY_ID_VALUE)); Node testParentNode = new Node(); ClinicalDocumentDecoder objectUnderTest = new ClinicalDocumentDecoder(new Context()); objectUnderTest.setNamespace(clinicalDocument.getNamespace()); @@ -315,8 +316,8 @@ void decodePcfPracticeSiteAddressTest() { @Test void decodePcfTinTest() { - Element clinicalDocument = makeClinicalDocument(ClinicalDocumentDecoder.CPCPLUS_PROGRAM_NAME); - clinicalDocument.addContent( prepareParticipant(clinicalDocument.getNamespace(), CPC_PRACTICE_ROOT) ); + Element clinicalDocument = makeClinicalDocument(ClinicalDocumentDecoder.CPCPLUS_PROGRAM_NAME, false, false); + clinicalDocument.addContent( prepareParticipant(clinicalDocument.getNamespace(), CPC_PRACTICE_ROOT, ENTITY_ID_VALUE)); Node testParentNode = new Node(); ClinicalDocumentDecoder objectUnderTest = new ClinicalDocumentDecoder(new Context()); objectUnderTest.setNamespace(clinicalDocument.getNamespace()); @@ -328,7 +329,7 @@ void decodePcfTinTest() { @Test void testClinicalDocumentDecodeProgramPcf() { - Element clinicalDocument = makeClinicalDocument(ClinicalDocumentDecoder.PCF); + Element clinicalDocument = makeClinicalDocument(ClinicalDocumentDecoder.PCF, false, false); Node testParentNode = new Node(); ClinicalDocumentDecoder objectUnderTest = new ClinicalDocumentDecoder(new Context()); objectUnderTest.setNamespace(clinicalDocument.getNamespace()); @@ -344,8 +345,8 @@ void testClinicalDocumentDecodeProgramPcf() { @Test void testClinicalDocumentDecodePcfTin() { - Element clinicalDocument = makeClinicalDocument(ClinicalDocumentDecoder.PCF); - clinicalDocument.addContent( prepareParticipant(clinicalDocument.getNamespace(), CPC_PRACTICE_ROOT) ); + Element clinicalDocument = makeClinicalDocument(ClinicalDocumentDecoder.PCF, false, false); + clinicalDocument.addContent( prepareParticipant(clinicalDocument.getNamespace(), CPC_PRACTICE_ROOT, ENTITY_ID_VALUE)); Node testParentNode = new Node(); ClinicalDocumentDecoder objectUnderTest = new ClinicalDocumentDecoder(new Context()); objectUnderTest.setNamespace(clinicalDocument.getNamespace()); @@ -357,8 +358,8 @@ void testClinicalDocumentDecodePcfTin() { @Test void testClinicalDocumentDecodePcfNpi() { - Element clinicalDocument = makeClinicalDocument(ClinicalDocumentDecoder.PCF); - clinicalDocument.addContent(prepareParticipant(clinicalDocument.getNamespace(), PCF_PRACTICE_ROOT)); + Element clinicalDocument = makeClinicalDocument(ClinicalDocumentDecoder.PCF, false, false); + clinicalDocument.addContent(prepareParticipant(clinicalDocument.getNamespace(), PCF_PRACTICE_ROOT, ENTITY_ID_VALUE)); Node testParentNode = new Node(); ClinicalDocumentDecoder objectUnderTest = new ClinicalDocumentDecoder(new Context()); objectUnderTest.setNamespace(clinicalDocument.getNamespace()); @@ -370,8 +371,8 @@ void testClinicalDocumentDecodePcfNpi() { @Test void testClinicalDocumentDecodePcfEntityId() { - Element clinicalDocument = makeClinicalDocument(ClinicalDocumentDecoder.PCF); - clinicalDocument.addContent(prepareParticipant(clinicalDocument.getNamespace(), PCF_PRACTICE_ROOT)); + Element clinicalDocument = makeClinicalDocument(ClinicalDocumentDecoder.PCF, false, false); + clinicalDocument.addContent(prepareParticipant(clinicalDocument.getNamespace(), PCF_PRACTICE_ROOT, ENTITY_ID_VALUE)); Node testParentNode = new Node(); ClinicalDocumentDecoder objectUnderTest = new ClinicalDocumentDecoder(new Context()); objectUnderTest.setNamespace(clinicalDocument.getNamespace()); @@ -383,8 +384,8 @@ void testClinicalDocumentDecodePcfEntityId() { @Test void testClinicalDocumentDecodePcfPracticeSiteAddress() { - Element clinicalDocument = makeClinicalDocument(ClinicalDocumentDecoder.PCF); - clinicalDocument.addContent(prepareParticipant(clinicalDocument.getNamespace(), PCF_PRACTICE_ROOT)); + Element clinicalDocument = makeClinicalDocument(ClinicalDocumentDecoder.PCF, false, false); + clinicalDocument.addContent(prepareParticipant(clinicalDocument.getNamespace(), PCF_PRACTICE_ROOT, ENTITY_ID_VALUE)); Node testParentNode = new Node(); ClinicalDocumentDecoder objectUnderTest = new ClinicalDocumentDecoder(new Context()); objectUnderTest.setNamespace(clinicalDocument.getNamespace()); @@ -396,7 +397,7 @@ void testClinicalDocumentDecodePcfPracticeSiteAddress() { @Test void decodeMipsVirtualGroup() { - Element clinicalDocument = makeClinicalDocument(ClinicalDocumentDecoder.MIPS_VIRTUAL_GROUP); + Element clinicalDocument = makeClinicalDocument(ClinicalDocumentDecoder.MIPS_VIRTUAL_GROUP, false, false); Node testParentNode = new Node(); ClinicalDocumentDecoder objectUnderTest = new ClinicalDocumentDecoder(new Context()); @@ -411,8 +412,8 @@ void decodeMipsVirtualGroup() { @Test void decodeMipsApmTest() { - Element clinicalDocument = makeClinicalDocument(ClinicalDocumentDecoder.MIPS_APM); - clinicalDocument.addContent(prepareParticipant(clinicalDocument.getNamespace(), CPC_PRACTICE_ROOT)); + Element clinicalDocument = makeClinicalDocument(ClinicalDocumentDecoder.MIPS_APM, false, false); + clinicalDocument.addContent(prepareParticipant(clinicalDocument.getNamespace(), CPC_PRACTICE_ROOT, ENTITY_ID_VALUE)); Node testParentNode = new Node(); ClinicalDocumentDecoder objectUnderTest = new ClinicalDocumentDecoder(new Context()); @@ -427,7 +428,7 @@ void decodeMipsApmTest() { @Test void decodeMipsAppApmTest() { - Element clinicalDocument = makeClinicalDocument(ClinicalDocumentDecoder.APP_APM); + Element clinicalDocument = makeClinicalDocument(ClinicalDocumentDecoder.APP_APM, false, false); Node testParentNode = new Node(); ClinicalDocumentDecoder objectUnderTest = new ClinicalDocumentDecoder(new Context()); @@ -440,18 +441,90 @@ void decodeMipsAppApmTest() { .isEqualTo("TEST_APM"); } - private Element makeClinicalDocument(String programName) { + @Test + void decodeMvpMipsAppApmTest() { + Element clinicalDocument = makeClinicalDocument(ClinicalDocumentDecoder.MIPS_APM, false, true); + Node testParentNode = new Node(); + + ClinicalDocumentDecoder objectUnderTest = new ClinicalDocumentDecoder(new Context()); + objectUnderTest.setNamespace(clinicalDocument.getNamespace()); + objectUnderTest.decode(clinicalDocument, testParentNode); + + assertThat(testParentNode.getValue(ClinicalDocumentDecoder.ENTITY_TYPE)) + .isEqualTo(ClinicalDocumentDecoder.ENTITY_APM); + assertThat(testParentNode.getValue(ClinicalDocumentDecoder.ENTITY_ID)) + .isEqualTo("TEST_APM"); + assertThat(testParentNode.getValue(ClinicalDocumentDecoder.MVP_ID)) + .isEqualTo(TEST_MVP_ID); + } + + @Test + void decodeMvpMipsIndividualTest() { + Element clinicalDocument = makeClinicalDocument(ClinicalDocumentDecoder.MIPS_INDIVIDUAL, false, true); + Node testParentNode = new Node(); + + ClinicalDocumentDecoder objectUnderTest = new ClinicalDocumentDecoder(new Context()); + objectUnderTest.setNamespace(clinicalDocument.getNamespace()); + objectUnderTest.decode(clinicalDocument, testParentNode); + + assertThat(testParentNode.getValue(ClinicalDocumentDecoder.TAX_PAYER_IDENTIFICATION_NUMBER)) + .isEqualTo(TEST_TIN); + assertThat(testParentNode.getValue(ClinicalDocumentDecoder.NATIONAL_PROVIDER_IDENTIFIER)) + .isEqualTo(TEST_NPI); + assertThat(testParentNode.getValue(ClinicalDocumentDecoder.MVP_ID)) + .isEqualTo(TEST_MVP_ID); + } + + @Test + void decodeMvpMipsGroupTest() { + Element clinicalDocument = makeClinicalDocument(ClinicalDocumentDecoder.MIPS_GROUP, false, true); + Node testParentNode = new Node(); + + ClinicalDocumentDecoder objectUnderTest = new ClinicalDocumentDecoder(new Context()); + objectUnderTest.setNamespace(clinicalDocument.getNamespace()); + objectUnderTest.decode(clinicalDocument, testParentNode); + + assertThat(testParentNode.getValue(ClinicalDocumentDecoder.TAX_PAYER_IDENTIFICATION_NUMBER)) + .isEqualTo(TEST_TIN); + assertThat(testParentNode.getValue(ClinicalDocumentDecoder.MVP_ID)) + .isEqualTo(TEST_MVP_ID); + } + + @Test + void decodeMvpMipsSubgroupTest() { + Element clinicalDocument = makeClinicalDocument(ClinicalDocumentDecoder.MIPS_SUBGROUP, true, true); + Node testParentNode = new Node(); + + ClinicalDocumentDecoder objectUnderTest = new ClinicalDocumentDecoder(new Context()); + objectUnderTest.setNamespace(clinicalDocument.getNamespace()); + objectUnderTest.decode(clinicalDocument, testParentNode); + + assertThat(testParentNode.getValue(ClinicalDocumentDecoder.ENTITY_TYPE)) + .isEqualTo(ClinicalDocumentDecoder.ENTITY_SUBGROUP); + assertThat(testParentNode.getValue(ClinicalDocumentDecoder.SUBGROUP_ID)) + .isEqualTo(TEST_SUBGROUP_ID); + assertThat(testParentNode.getValue(ClinicalDocumentDecoder.MVP_ID)) + .isEqualTo(TEST_MVP_ID); + } + + private Element makeClinicalDocument(String programName, boolean isSubgroup, boolean isMvp) { Namespace rootns = Namespace.getNamespace("urn:hl7-org:v3"); Namespace ns = Namespace.getNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance"); Element clinicalDocument = new Element("ClinicalDocument", rootns); clinicalDocument.addNamespaceDeclaration(ns); Element informationRecipient = prepareInfoRecipient(rootns, programName); - Element documentationOf = prepareDocumentationElement(rootns); + if (isMvp) { + clinicalDocument.addContent(prepareParticipant(rootns, "2.16.840.1.113883.3.249.5.6", TEST_MVP_ID)); + } + if (isSubgroup) { + clinicalDocument.addContent(prepareSubgroupDocumentationElement(rootns)); + } else { + clinicalDocument.addContent(prepareDocumentationElement(rootns)); + } Element component = prepareComponentElement(rootns); clinicalDocument.addContent(informationRecipient); - clinicalDocument.addContent(documentationOf); clinicalDocument.addContent(component); return clinicalDocument; } @@ -468,13 +541,13 @@ private Element prepareInfoRecipient(Namespace rootns, String programName) { } // This is the Entity Id for CPCPlus program name - private Element prepareParticipant(Namespace rootns, String root) { + private Element prepareParticipant(Namespace rootns, String root, String id) { Element participant = new Element("participant", rootns); Element associatedEntity = new Element("associatedEntity", rootns); Element entityId = new Element("id", rootns) .setAttribute("root", root) - .setAttribute("extension", ENTITY_ID_VALUE) + .setAttribute("extension", id) .setAttribute("assigningAuthorityName", "CMS-CMMI"); Element addr = new Element("addr", rootns) .setText("testing123"); @@ -536,6 +609,31 @@ private Element prepareRepOrgWithTaxPayerId(Namespace rootns, String taxId) { return representedOrganization; } + private Element prepareSubgroupDocumentationElement(Namespace rootns) { + Element documentationOf = new Element("documentationOf", rootns); + Element serviceEvent = new Element("serviceEvent", rootns); + Element performer = new Element("performer", rootns); + Element assignedEntity = new Element("assignedEntity", rootns); + + Element representedOrganization = prepareRepOrgWithSubgroupId(rootns, TEST_SUBGROUP_ID); + assignedEntity.addContent(representedOrganization); + performer.addContent(assignedEntity); + + serviceEvent.addContent(performer); + documentationOf.addContent(serviceEvent); + return documentationOf; + } + + private Element prepareRepOrgWithSubgroupId(Namespace rootns, String subgroupId) { + Element representedOrganization = new Element("representedOrganization", rootns); + Element taxpayerIdentificationNumber = new Element("id", rootns) + .setAttribute("root", "2.16.840.1.113883.3.249.5.5") + .setAttribute("extension", subgroupId); + + representedOrganization.addContent(taxpayerIdentificationNumber); + return representedOrganization; + } + private Element prepareComponentElement(Namespace rootns) { Element component = new Element("component", rootns); Element structuredBody = new Element("structuredBody", rootns);