From b86c73b369235ccab9267f82e854cf13ed970f4e Mon Sep 17 00:00:00 2001 From: Mahi Fentaye <168698136+MahiFentaye@users.noreply.github.com> Date: Fri, 24 Jan 2025 10:53:16 -0500 Subject: [PATCH] BFD-3665 - Populate Tags in FHIR Resource (#2512) --- .../pipeline/ccw/rif/load/RifLoaderIT.java | 2 +- .../bfd/pipeline/sharedutils/SamhsaUtil.java | 2 +- .../adapters/SamhsaCarrierAdapter.java | 2 +- .../adapters/SamhsaDmeAdapter.java | 2 +- .../adapters/SamhsaHHAAdapter.java | 2 +- .../adapters/SamhsaHospiceAdapter.java | 2 +- .../adapters/SamhsaInpatientAdapter.java | 2 +- .../adapters/SamhsaOutpatientAdapter.java | 2 +- .../adapters/SamhsaSnfAdapter.java | 3 +- .../pipeline/sharedutils/model/TagCode.java | 26 - .../war/commons/SecurityTagManager.java | 126 ++ .../war/commons/TransformerConstants.java | 15 + .../providers/CarrierClaimTransformerV2.java | 24 +- .../r4/providers/DMEClaimTransformerV2.java | 24 +- .../r4/providers/HHAClaimTransformerV2.java | 24 +- .../providers/HospiceClaimTransformerV2.java | 24 +- .../InpatientClaimTransformerV2.java | 24 +- .../OutpatientClaimTransformerV2.java | 24 +- .../r4/providers/SNFClaimTransformerV2.java | 24 +- .../pac/FissClaimResponseTransformerV2.java | 24 +- .../providers/pac/FissClaimTransformerV2.java | 23 +- .../pac/McsClaimResponseTransformerV2.java | 23 +- .../providers/pac/McsClaimTransformerV2.java | 25 +- .../providers/CarrierClaimTransformer.java | 24 +- .../stu3/providers/DMEClaimTransformer.java | 26 +- .../stu3/providers/HHAClaimTransformer.java | 25 +- .../providers/HospiceClaimTransformer.java | 26 +- .../providers/InpatientClaimTransformer.java | 27 +- .../providers/OutpatientClaimTransformer.java | 26 +- .../stu3/providers/SNFClaimTransformer.java | 25 +- .../war/EndpointJsonComparatorBase.java | 44 +- .../CarrierClaimTransformerV2Test.java | 8 +- .../providers/DMEClaimTransformerV2Test.java | 7 +- .../EndpointJsonResponseComparatorV2E2E.java | 24 + .../providers/HHAClaimTransformerV2Test.java | 7 +- .../HospiceClaimTransformerV2Test.java | 7 +- .../InpatientClaimTransformerV2Test.java | 7 +- .../OutpatientClaimTransformerV2Test.java | 9 +- ...PatientClaimsEobTaskTransformerV2Test.java | 26 +- .../providers/SNFClaimTransformerV2Test.java | 7 +- ...saMatcherR4FromClaimTransformerV2Test.java | 20 +- .../r4/providers/TransformerTestUtilsV2.java | 26 +- .../r4/providers/TransformerUtilsV2Test.java | 21 +- .../pac/FissClaimTransformerV2Test.java | 5 +- .../pac/McsClaimTransformerV2Test.java | 6 +- .../R4ClaimSamhsaMatcherTransformerTest.java | 14 +- .../CarrierClaimTransformerTest.java | 7 +- .../providers/DMEClaimTransformerTest.java | 7 +- .../EndpointJsonResponseComparatorE2E.java | 23 + .../providers/HHAClaimTransformerTest.java | 7 +- .../HospiceClaimTransformerTest.java | 7 +- .../InpatientClaimTransformerTest.java | 7 +- .../OutpatientClaimTransformerTest.java | 7 +- .../PatientClaimsEobTaskTransformerTest.java | 26 +- .../providers/SNFClaimTransformerTest.java | 7 +- ...SamhsaMatcherFromClaimTransformerTest.java | 21 +- .../providers/SecurityTagManagerTest.java | 76 + .../providers/Stu3EobSamhsaMatcherTest.java | 16 +- .../stu3/providers/TransformerTestUtils.java | 26 +- .../stu3/providers/TransformerUtilsTest.java | 19 +- .../v1/eobByPatientIdAll.json | 49 +- .../v1/eobByPatientIdAllWithSamhsa.json | 1042 +++++++++++++ .../v1/eobByPatientIdPaged.json | 49 +- .../endpoint-responses/v1/eobReadCarrier.json | 7 +- .../v1/eobReadCarrierMultipleLines.json | 7 +- .../v1/eobReadCarrierWithTaxNumbers.json | 7 +- .../endpoint-responses/v1/eobReadDme.json | 7 +- .../v1/eobReadDmeWithTaxNumbers.json | 7 +- .../endpoint-responses/v1/eobReadHha.json | 7 +- .../endpoint-responses/v1/eobReadHospice.json | 7 +- .../v1/eobReadInpatient.json | 7 +- .../v1/eobReadOutpatient.json | 7 +- .../endpoint-responses/v1/eobReadSnf.json | 7 +- .../endpoint-responses/v2/claimFissRead.json | 7 +- .../v2/claimFissReadWithTaxNumbers.json | 7 +- .../endpoint-responses/v2/claimMcsRead.json | 7 +- .../v2/claimMcsReadWithTaxNumbers.json | 7 +- .../v2/claimResponseFissRead.json | 7 +- .../v2/claimResponseMcsRead.json | 7 +- .../v2/claimResponseSearch.json | 14 +- .../v2/claimResponseSearchPaginated.json | 7 +- .../endpoint-responses/v2/claimSearch.json | 14 +- .../v2/claimSearchPaginated.json | 7 +- .../v2/claimSearchWithTaxNumbers.json | 14 +- .../v2/eobByPatientIdAll.json | 49 +- .../v2/eobByPatientIdPaged.json | 49 +- .../v2/eobReadByPatientWithSamhsa.json | 1371 +++++++++++++++++ .../endpoint-responses/v2/eobReadCarrier.json | 7 +- .../v2/eobReadCarrierWithMultipleLines.json | 7 +- .../v2/eobReadCarrierWithTaxNumbers.json | 7 +- .../endpoint-responses/v2/eobReadDme.json | 7 +- .../v2/eobReadDmeWithTaxNumbers.json | 7 +- .../endpoint-responses/v2/eobReadHha.json | 7 +- .../endpoint-responses/v2/eobReadHospice.json | 7 +- .../v2/eobReadInpatient.json | 7 +- .../v2/eobReadOutpatient.json | 7 +- .../endpoint-responses/v2/eobReadSnf.json | 7 +- .../java/gov/cms/bfd/sharedutils/TagCode.java | 51 + 98 files changed, 3780 insertions(+), 240 deletions(-) delete mode 100644 apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/model/TagCode.java create mode 100644 apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/commons/SecurityTagManager.java create mode 100644 apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/SecurityTagManagerTest.java create mode 100644 apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobByPatientIdAllWithSamhsa.json create mode 100644 apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadByPatientWithSamhsa.json create mode 100644 apps/bfd-shared-utils/src/main/java/gov/cms/bfd/sharedutils/TagCode.java diff --git a/apps/bfd-pipeline/bfd-pipeline-ccw-rif/src/test/java/gov/cms/bfd/pipeline/ccw/rif/load/RifLoaderIT.java b/apps/bfd-pipeline/bfd-pipeline-ccw-rif/src/test/java/gov/cms/bfd/pipeline/ccw/rif/load/RifLoaderIT.java index 99f71b0ea6..06c4a042ce 100644 --- a/apps/bfd-pipeline/bfd-pipeline-ccw-rif/src/test/java/gov/cms/bfd/pipeline/ccw/rif/load/RifLoaderIT.java +++ b/apps/bfd-pipeline/bfd-pipeline-ccw-rif/src/test/java/gov/cms/bfd/pipeline/ccw/rif/load/RifLoaderIT.java @@ -42,7 +42,7 @@ import gov.cms.bfd.pipeline.ccw.rif.extract.s3.DataSetManifest.DataSetManifestEntry; import gov.cms.bfd.pipeline.ccw.rif.extract.s3.DataSetManifest.PreValidationProperties; import gov.cms.bfd.pipeline.sharedutils.IdHasher; -import gov.cms.bfd.pipeline.sharedutils.model.TagCode; +import gov.cms.bfd.sharedutils.TagCode; import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManagerFactory; import jakarta.persistence.EntityTransaction; diff --git a/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/SamhsaUtil.java b/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/SamhsaUtil.java index 5dbb9600d8..0f27d1b866 100644 --- a/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/SamhsaUtil.java +++ b/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/SamhsaUtil.java @@ -27,8 +27,8 @@ import gov.cms.bfd.pipeline.sharedutils.adapters.SamhsaOutpatientAdapter; import gov.cms.bfd.pipeline.sharedutils.adapters.SamhsaSnfAdapter; import gov.cms.bfd.pipeline.sharedutils.model.SamhsaEntry; -import gov.cms.bfd.pipeline.sharedutils.model.TagCode; import gov.cms.bfd.pipeline.sharedutils.model.TagDetails; +import gov.cms.bfd.sharedutils.TagCode; import jakarta.persistence.EntityManager; import java.io.IOException; import java.io.InputStream; diff --git a/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/adapters/SamhsaCarrierAdapter.java b/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/adapters/SamhsaCarrierAdapter.java index ec8c3340ac..d10aa5ee66 100644 --- a/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/adapters/SamhsaCarrierAdapter.java +++ b/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/adapters/SamhsaCarrierAdapter.java @@ -7,8 +7,8 @@ import gov.cms.bfd.model.rif.samhsa.CarrierTag; import gov.cms.bfd.pipeline.sharedutils.SamhsaUtil; import gov.cms.bfd.pipeline.sharedutils.model.SamhsaFields; -import gov.cms.bfd.pipeline.sharedutils.model.TagCode; import gov.cms.bfd.pipeline.sharedutils.model.TagDetails; +import gov.cms.bfd.sharedutils.TagCode; import jakarta.persistence.EntityManager; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; diff --git a/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/adapters/SamhsaDmeAdapter.java b/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/adapters/SamhsaDmeAdapter.java index 5fc1ec970d..91bf5637d0 100644 --- a/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/adapters/SamhsaDmeAdapter.java +++ b/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/adapters/SamhsaDmeAdapter.java @@ -7,8 +7,8 @@ import gov.cms.bfd.model.rif.samhsa.DmeTag; import gov.cms.bfd.pipeline.sharedutils.SamhsaUtil; import gov.cms.bfd.pipeline.sharedutils.model.SamhsaFields; -import gov.cms.bfd.pipeline.sharedutils.model.TagCode; import gov.cms.bfd.pipeline.sharedutils.model.TagDetails; +import gov.cms.bfd.sharedutils.TagCode; import jakarta.persistence.EntityManager; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; diff --git a/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/adapters/SamhsaHHAAdapter.java b/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/adapters/SamhsaHHAAdapter.java index 5738bf5750..67d2e5d49c 100644 --- a/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/adapters/SamhsaHHAAdapter.java +++ b/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/adapters/SamhsaHHAAdapter.java @@ -7,8 +7,8 @@ import gov.cms.bfd.model.rif.samhsa.HhaTag; import gov.cms.bfd.pipeline.sharedutils.SamhsaUtil; import gov.cms.bfd.pipeline.sharedutils.model.SamhsaFields; -import gov.cms.bfd.pipeline.sharedutils.model.TagCode; import gov.cms.bfd.pipeline.sharedutils.model.TagDetails; +import gov.cms.bfd.sharedutils.TagCode; import jakarta.persistence.EntityManager; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; diff --git a/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/adapters/SamhsaHospiceAdapter.java b/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/adapters/SamhsaHospiceAdapter.java index 24206571bd..cf884fad1a 100644 --- a/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/adapters/SamhsaHospiceAdapter.java +++ b/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/adapters/SamhsaHospiceAdapter.java @@ -7,8 +7,8 @@ import gov.cms.bfd.model.rif.samhsa.HospiceTag; import gov.cms.bfd.pipeline.sharedutils.SamhsaUtil; import gov.cms.bfd.pipeline.sharedutils.model.SamhsaFields; -import gov.cms.bfd.pipeline.sharedutils.model.TagCode; import gov.cms.bfd.pipeline.sharedutils.model.TagDetails; +import gov.cms.bfd.sharedutils.TagCode; import jakarta.persistence.EntityManager; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; diff --git a/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/adapters/SamhsaInpatientAdapter.java b/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/adapters/SamhsaInpatientAdapter.java index 7a20cf1d0e..7bf07d9b08 100644 --- a/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/adapters/SamhsaInpatientAdapter.java +++ b/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/adapters/SamhsaInpatientAdapter.java @@ -7,8 +7,8 @@ import gov.cms.bfd.model.rif.samhsa.InpatientTag; import gov.cms.bfd.pipeline.sharedutils.SamhsaUtil; import gov.cms.bfd.pipeline.sharedutils.model.SamhsaFields; -import gov.cms.bfd.pipeline.sharedutils.model.TagCode; import gov.cms.bfd.pipeline.sharedutils.model.TagDetails; +import gov.cms.bfd.sharedutils.TagCode; import jakarta.persistence.EntityManager; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; diff --git a/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/adapters/SamhsaOutpatientAdapter.java b/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/adapters/SamhsaOutpatientAdapter.java index 242046dae4..07c5760477 100644 --- a/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/adapters/SamhsaOutpatientAdapter.java +++ b/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/adapters/SamhsaOutpatientAdapter.java @@ -7,8 +7,8 @@ import gov.cms.bfd.model.rif.samhsa.OutpatientTag; import gov.cms.bfd.pipeline.sharedutils.SamhsaUtil; import gov.cms.bfd.pipeline.sharedutils.model.SamhsaFields; -import gov.cms.bfd.pipeline.sharedutils.model.TagCode; import gov.cms.bfd.pipeline.sharedutils.model.TagDetails; +import gov.cms.bfd.sharedutils.TagCode; import jakarta.persistence.EntityManager; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; diff --git a/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/adapters/SamhsaSnfAdapter.java b/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/adapters/SamhsaSnfAdapter.java index 4afdbba113..5cc6509846 100644 --- a/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/adapters/SamhsaSnfAdapter.java +++ b/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/adapters/SamhsaSnfAdapter.java @@ -1,6 +1,5 @@ package gov.cms.bfd.pipeline.sharedutils.adapters; -import static java.util.Map.*; import static java.util.Map.entry; import gov.cms.bfd.model.rif.entities.SNFClaim; @@ -8,8 +7,8 @@ import gov.cms.bfd.model.rif.samhsa.SnfTag; import gov.cms.bfd.pipeline.sharedutils.SamhsaUtil; import gov.cms.bfd.pipeline.sharedutils.model.SamhsaFields; -import gov.cms.bfd.pipeline.sharedutils.model.TagCode; import gov.cms.bfd.pipeline.sharedutils.model.TagDetails; +import gov.cms.bfd.sharedutils.TagCode; import jakarta.persistence.EntityManager; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; diff --git a/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/model/TagCode.java b/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/model/TagCode.java deleted file mode 100644 index 6fb7ee60ee..0000000000 --- a/apps/bfd-pipeline/bfd-pipeline-shared-utils/src/main/java/gov/cms/bfd/pipeline/sharedutils/model/TagCode.java +++ /dev/null @@ -1,26 +0,0 @@ -package gov.cms.bfd.pipeline.sharedutils.model; - -/** ENUM of TAG codes. */ -public enum TagCode { - /** Tag Code R. */ - R("R"), - /** Tag Code 42CFRPart2. */ - _42CFRPart2("42CFRPart2"); - - /** Name of the enum in the DB. */ - private String dbName; - - /** - * Constructor. - * - * @param dbName Sets the DB name of the enum. - */ - TagCode(String dbName) { - this.dbName = dbName; - } - - @Override - public String toString() { - return this.dbName; - } -} diff --git a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/commons/SecurityTagManager.java b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/commons/SecurityTagManager.java new file mode 100644 index 0000000000..4016899bff --- /dev/null +++ b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/commons/SecurityTagManager.java @@ -0,0 +1,126 @@ +package gov.cms.bfd.server.war.commons; + +import gov.cms.bfd.sharedutils.TagCode; +import jakarta.persistence.EntityManager; +import jakarta.persistence.PersistenceContext; +import jakarta.persistence.Query; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import org.hl7.fhir.r4.model.Coding; +import org.springframework.stereotype.Service; + +/** Find security level. */ +@Service +public final class SecurityTagManager { + + /** The Entity manager. */ + private EntityManager entityManager; + + /** + * Sets the {@link #entityManager}. + * + * @param entityManager a JPA {@link EntityManager} connected to the application's database + */ + @PersistenceContext + public void setEntityManager(EntityManager entityManager) { + this.entityManager = entityManager; + } + + /** + * Query tags for a specific claim from a specific table. + * + * @param claimId the name of the variable + * @param tagClass the name of the tag class + * @return queryTagsForClaim + */ + public Set queryTagsForClaim(String claimId, Class tagClass) { + + String sql = "SELECT t.code FROM " + tagClass.getSimpleName() + " t WHERE t.claim = :claim"; + + Query query = entityManager.createQuery(sql); + query.setParameter("claim", claimId); + + @SuppressWarnings("unchecked") + List resultList = query.getResultList(); + + return new HashSet<>(resultList); + } + + /** + * Determines the security level based on the collected tags. + * + * @param claimId value of claimId + * @param tagClass value of tagClass + * @return SecurityLevel + */ + public List getClaimSecurityLevel(String claimId, Class tagClass) { + + // Query tags associated with the claim + List securityTags = queryTagsForClaim(claimId, tagClass).stream().toList(); + + List securityTagCoding = new ArrayList<>(); + + // If no security tags are found, directly add the default "Normal" tag + if (securityTags.isEmpty()) { + Coding coding = new Coding(); + coding + .setSystem(TransformerConstants.SAMHSA_CONFIDENTIALITY_CODE_SYSTEM_URL) + .setCode("N") + .setDisplay("Normal"); + securityTagCoding.add(coding); + } else { + // Check for each tag and set corresponding code and display + for (String securityTag : securityTags) { + Coding coding = new Coding(); + // Convert the securityTag string to the TagCode enum + TagCode tagCode = TagCode.fromString(securityTag); + // Check each security tag and apply corresponding values + if (tagCode != null) { + switch (tagCode) { + case R: + coding + .setSystem(TransformerConstants.SAMHSA_CONFIDENTIALITY_CODE_SYSTEM_URL) + .setCode(TagCode.R.toString()) + .setDisplay(TagCode.R.getDisplayName()); + break; + case _42CFRPart2: + coding + .setSystem(TransformerConstants.SAMHSA_ACT_CODE_SYSTEM_URL) + .setCode(TagCode._42CFRPart2.toString()) + .setDisplay(TagCode._42CFRPart2.getDisplayName()); + break; + } + } + securityTagCoding.add(coding); + } + } + + return securityTagCoding; + } + + /** + * Determines the security level based on the collected tags. + * + * @param claimId value of claimId + * @param tagClass value of tagClass + * @return SecurityLevel + */ + public List getClaimSecurityLevelDstu3( + String claimId, Class tagClass) { + + List securityTagCoding = new ArrayList<>(); + List coding = getClaimSecurityLevel(claimId, tagClass); + for (Coding code : coding) { + org.hl7.fhir.dstu3.model.Coding securityTag = new org.hl7.fhir.dstu3.model.Coding(); + securityTag + .setSystem("http://terminology.hl7.org/CodeSystem/v3-Confidentiality") + .setCode(code.getCode()) + .setDisplay(code.getDisplay()); + + securityTagCoding.add(securityTag); + } + return securityTagCoding; + } +} diff --git a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/commons/TransformerConstants.java b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/commons/TransformerConstants.java index 0c2994bee0..2965956e56 100644 --- a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/commons/TransformerConstants.java +++ b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/commons/TransformerConstants.java @@ -703,4 +703,19 @@ public enum CurrencyIdentifier { */ public static final String C4DIC_LOGO_URL = "https://www.hhs.gov/sites/default/files/logo-white-lg.png"; + + /** + * URL for v3 Confidentiality Code System HL7 v3 Confidentiality Code + * System. + */ + public static final String SAMHSA_CONFIDENTIALITY_CODE_SYSTEM_URL = + "http://terminology.hl7.org/CodeSystem/v3-Confidentiality"; + + /** + * URL for v3 Act Code System v3 Act + * Code System. + */ + public static final String SAMHSA_ACT_CODE_SYSTEM_URL = + "http://terminology.hl7.org/CodeSystem/v3-ActCode"; } diff --git a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/CarrierClaimTransformerV2.java b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/CarrierClaimTransformerV2.java index 18aabb3d6c..be90f6dbac 100644 --- a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/CarrierClaimTransformerV2.java +++ b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/CarrierClaimTransformerV2.java @@ -10,19 +10,23 @@ import gov.cms.bfd.model.codebook.data.CcwCodebookVariable; import gov.cms.bfd.model.rif.entities.CarrierClaim; import gov.cms.bfd.model.rif.entities.CarrierClaimLine; +import gov.cms.bfd.model.rif.samhsa.CarrierTag; import gov.cms.bfd.server.war.commons.ClaimType; import gov.cms.bfd.server.war.commons.Diagnosis; import gov.cms.bfd.server.war.commons.Diagnosis.DiagnosisLabel; import gov.cms.bfd.server.war.commons.MedicareSegment; import gov.cms.bfd.server.war.commons.Profile; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.carin.C4BBAdjudication; import gov.cms.bfd.server.war.commons.carin.C4BBClaimProfessionalAndNonClinicianCareTeamRole; import gov.cms.bfd.server.war.commons.carin.C4BBPractitionerIdentifierType; import gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException; import java.math.BigDecimal; import java.util.Arrays; +import java.util.List; import java.util.Map; import java.util.Optional; +import org.hl7.fhir.r4.model.Coding; import org.hl7.fhir.r4.model.ExplanationOfBenefit; import org.hl7.fhir.r4.model.ExplanationOfBenefit.CareTeamComponent; import org.hl7.fhir.r4.model.ExplanationOfBenefit.ItemComponent; @@ -48,6 +52,9 @@ final class CarrierClaimTransformerV2 implements ClaimTransformerInterfaceV2 { private static final String METRIC_NAME = MetricRegistry.name(CarrierClaimTransformerV2.class.getSimpleName(), "transform"); + /** The securityTagManager. */ + private final SecurityTagManager securityTagManager; + /** * Instantiates a new transformer. * @@ -58,14 +65,17 @@ final class CarrierClaimTransformerV2 implements ClaimTransformerInterfaceV2 { * @param metricRegistry the metric registry * @param drugCodeDisplayLookup the drug code display lookup * @param npiOrgLookup the npi org lookup + * @param securityTagManager SamhsaSecurityTags lookup */ public CarrierClaimTransformerV2( MetricRegistry metricRegistry, FdaDrugCodeDisplayLookup drugCodeDisplayLookup, - NPIOrgLookup npiOrgLookup) { + NPIOrgLookup npiOrgLookup, + SecurityTagManager securityTagManager) { this.metricRegistry = requireNonNull(metricRegistry); this.npiOrgLookup = requireNonNull(npiOrgLookup); this.drugCodeDisplayLookup = requireNonNull(drugCodeDisplayLookup); + this.securityTagManager = requireNonNull(securityTagManager); } /** @@ -83,7 +93,11 @@ public ExplanationOfBenefit transform(Object claim, boolean includeTaxNumber) { } ExplanationOfBenefit eob; try (Timer.Context ignored = metricRegistry.timer(METRIC_NAME).time()) { - eob = transformClaim((CarrierClaim) claim, includeTaxNumber); + CarrierClaim carrierClaim = (CarrierClaim) claim; + List securityTags = + securityTagManager.getClaimSecurityLevel( + String.valueOf(carrierClaim.getClaimId()), CarrierTag.class); + eob = transformClaim(carrierClaim, includeTaxNumber, securityTags); } return eob; } @@ -93,15 +107,19 @@ public ExplanationOfBenefit transform(Object claim, boolean includeTaxNumber) { * * @param claimGroup the CCW {@link CarrierClaim} to transform * @param includeTaxNumbers whether to include tax numbers in the response + * @param securityTags securityTags of the claim * @return a FHIR {@link ExplanationOfBenefit} resource that represents the specified {@link * CarrierClaim} */ - private ExplanationOfBenefit transformClaim(CarrierClaim claimGroup, boolean includeTaxNumbers) { + private ExplanationOfBenefit transformClaim( + CarrierClaim claimGroup, boolean includeTaxNumbers, List securityTags) { ExplanationOfBenefit eob = new ExplanationOfBenefit(); // Required values not directly mapped eob.getMeta().addProfile(Profile.C4BB.getVersionedEobNonclinicianUrl()); + eob.getMeta().setSecurity(securityTags); + // TODO: ExplanationOfBenefit.outcome is a required field. Needs to be mapped. // eob.setOutcome(?) diff --git a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/DMEClaimTransformerV2.java b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/DMEClaimTransformerV2.java index df02d767f5..0cffc598d5 100644 --- a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/DMEClaimTransformerV2.java +++ b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/DMEClaimTransformerV2.java @@ -10,18 +10,22 @@ import gov.cms.bfd.model.codebook.data.CcwCodebookVariable; import gov.cms.bfd.model.rif.entities.DMEClaim; import gov.cms.bfd.model.rif.entities.DMEClaimLine; +import gov.cms.bfd.model.rif.samhsa.DmeTag; import gov.cms.bfd.server.war.commons.ClaimType; import gov.cms.bfd.server.war.commons.Diagnosis; import gov.cms.bfd.server.war.commons.Diagnosis.DiagnosisLabel; import gov.cms.bfd.server.war.commons.MedicareSegment; import gov.cms.bfd.server.war.commons.Profile; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.carin.C4BBAdjudication; import gov.cms.bfd.server.war.commons.carin.C4BBClaimProfessionalAndNonClinicianCareTeamRole; import gov.cms.bfd.server.war.commons.carin.C4BBPractitionerIdentifierType; import gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException; import java.util.Arrays; +import java.util.List; import java.util.Map; import java.util.Optional; +import org.hl7.fhir.r4.model.Coding; import org.hl7.fhir.r4.model.ExplanationOfBenefit; import org.hl7.fhir.r4.model.ExplanationOfBenefit.CareTeamComponent; import org.hl7.fhir.r4.model.ExplanationOfBenefit.ItemComponent; @@ -46,6 +50,9 @@ final class DMEClaimTransformerV2 implements ClaimTransformerInterfaceV2 { private static final String METRIC_NAME = MetricRegistry.name(DMEClaimTransformerV2.class.getSimpleName(), "transform"); + /** The securityTagManager. */ + private final SecurityTagManager securityTagManager; + /** * Instantiates a new transformer. * @@ -56,14 +63,17 @@ final class DMEClaimTransformerV2 implements ClaimTransformerInterfaceV2 { * @param metricRegistry the metric registry * @param drugCodeDisplayLookup the drug code display lookup * @param npiOrgLookup the npi display lookup + * @param securityTagManager SamhsaSecurityTags lookup */ DMEClaimTransformerV2( MetricRegistry metricRegistry, FdaDrugCodeDisplayLookup drugCodeDisplayLookup, - NPIOrgLookup npiOrgLookup) { + NPIOrgLookup npiOrgLookup, + SecurityTagManager securityTagManager) { this.metricRegistry = requireNonNull(metricRegistry); this.drugCodeDisplayLookup = requireNonNull(drugCodeDisplayLookup); this.npiOrgLookup = npiOrgLookup; + this.securityTagManager = requireNonNull(securityTagManager); } /** @@ -82,7 +92,11 @@ public ExplanationOfBenefit transform(Object claim, boolean includeTaxNumber) { } ExplanationOfBenefit eob; try (Timer.Context ignored = metricRegistry.timer(METRIC_NAME).time()) { - eob = transformClaim((DMEClaim) claim, includeTaxNumber); + DMEClaim dmeClaim = (DMEClaim) claim; + List securityTags = + securityTagManager.getClaimSecurityLevel( + String.valueOf(dmeClaim.getClaimId()), DmeTag.class); + eob = transformClaim(dmeClaim, includeTaxNumber, securityTags); } return eob; } @@ -92,15 +106,19 @@ public ExplanationOfBenefit transform(Object claim, boolean includeTaxNumber) { * * @param includeTaxNumbers whether to include tax numbers in the transformed EOB * @param claimGroup the CCW {@link DMEClaim} to transform + * @param securityTags securityTags of the claim * @return a FHIR {@link ExplanationOfBenefit} resource that represents the specified {@link * DMEClaim} */ - private ExplanationOfBenefit transformClaim(DMEClaim claimGroup, boolean includeTaxNumbers) { + private ExplanationOfBenefit transformClaim( + DMEClaim claimGroup, boolean includeTaxNumbers, List securityTags) { ExplanationOfBenefit eob = new ExplanationOfBenefit(); // Required values not directly mapped eob.getMeta().addProfile(Profile.C4BB.getVersionedEobInpatientUrl()); + eob.getMeta().setSecurity(securityTags); + // Common group level fields between all claim types // Claim Type + Claim ID => ExplanationOfBenefit.id // CLM_ID => ExplanationOfBenefit.identifier diff --git a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/HHAClaimTransformerV2.java b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/HHAClaimTransformerV2.java index 42da112fad..4dcc0e74ff 100644 --- a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/HHAClaimTransformerV2.java +++ b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/HHAClaimTransformerV2.java @@ -9,17 +9,21 @@ import gov.cms.bfd.model.codebook.data.CcwCodebookVariable; import gov.cms.bfd.model.rif.entities.HHAClaim; import gov.cms.bfd.model.rif.entities.HHAClaimLine; +import gov.cms.bfd.model.rif.samhsa.HhaTag; import gov.cms.bfd.server.war.commons.C4BBInstutionalClaimSubtypes; import gov.cms.bfd.server.war.commons.ClaimType; import gov.cms.bfd.server.war.commons.MedicareSegment; import gov.cms.bfd.server.war.commons.Profile; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.carin.C4BBClaimProfessionalAndNonClinicianCareTeamRole; import gov.cms.bfd.server.war.commons.carin.C4BBOrganizationIdentifierType; import gov.cms.bfd.server.war.commons.carin.C4BBPractitionerIdentifierType; import gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException; import java.util.Arrays; +import java.util.List; import java.util.Map; import java.util.Optional; +import org.hl7.fhir.r4.model.Coding; import org.hl7.fhir.r4.model.ExplanationOfBenefit; import org.hl7.fhir.r4.model.ExplanationOfBenefit.ItemComponent; import org.hl7.fhir.r4.model.Quantity; @@ -39,6 +43,9 @@ final class HHAClaimTransformerV2 implements ClaimTransformerInterfaceV2 { private static final String METRIC_NAME = MetricRegistry.name(HHAClaimTransformerV2.class.getSimpleName(), "transform"); + /** The securityTagManager. */ + private final SecurityTagManager securityTagManager; + /** * Instantiates a new transformer. * @@ -48,10 +55,15 @@ final class HHAClaimTransformerV2 implements ClaimTransformerInterfaceV2 { * * @param metricRegistry the metric registry * @param npiOrgLookup the npi org lookup + * @param securityTagManager SamhsaSecurityTags lookup */ - public HHAClaimTransformerV2(MetricRegistry metricRegistry, NPIOrgLookup npiOrgLookup) { + public HHAClaimTransformerV2( + MetricRegistry metricRegistry, + NPIOrgLookup npiOrgLookup, + SecurityTagManager securityTagManager) { this.metricRegistry = requireNonNull(metricRegistry); this.npiOrgLookup = requireNonNull(npiOrgLookup); + this.securityTagManager = requireNonNull(securityTagManager); } /** @@ -69,7 +81,11 @@ public ExplanationOfBenefit transform(Object claim, boolean includeTaxNumber) { } ExplanationOfBenefit eob; try (Timer.Context ignored = metricRegistry.timer(METRIC_NAME).time()) { - eob = transformClaim((HHAClaim) claim); + HHAClaim hhaClaim = (HHAClaim) claim; + List securityTags = + securityTagManager.getClaimSecurityLevel( + String.valueOf(hhaClaim.getClaimId()), HhaTag.class); + eob = transformClaim(hhaClaim, securityTags); } return eob; } @@ -78,14 +94,16 @@ public ExplanationOfBenefit transform(Object claim, boolean includeTaxNumber) { * Transforms a specified {@link HHAClaim} into a FHIR {@link ExplanationOfBenefit}. * * @param claimGroup the CCW {@link HHAClaim} to transform + * @param securityTags securityTags of the claim * @return a FHIR {@link ExplanationOfBenefit} resource that represents the specified {@link * HHAClaim} */ - private ExplanationOfBenefit transformClaim(HHAClaim claimGroup) { + private ExplanationOfBenefit transformClaim(HHAClaim claimGroup, List securityTags) { ExplanationOfBenefit eob = new ExplanationOfBenefit(); // Required values not directly mapped eob.getMeta().addProfile(Profile.C4BB.getVersionedEobNonclinicianUrl()); + eob.getMeta().setSecurity(securityTags); // Common group level fields between all claim types // Claim Type + Claim ID => ExplanationOfBenefit.id diff --git a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/HospiceClaimTransformerV2.java b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/HospiceClaimTransformerV2.java index e804570141..270da08de7 100644 --- a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/HospiceClaimTransformerV2.java +++ b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/HospiceClaimTransformerV2.java @@ -9,18 +9,22 @@ import gov.cms.bfd.model.codebook.data.CcwCodebookVariable; import gov.cms.bfd.model.rif.entities.HospiceClaim; import gov.cms.bfd.model.rif.entities.HospiceClaimLine; +import gov.cms.bfd.model.rif.samhsa.HospiceTag; import gov.cms.bfd.server.war.commons.C4BBInstutionalClaimSubtypes; import gov.cms.bfd.server.war.commons.ClaimType; import gov.cms.bfd.server.war.commons.MedicareSegment; import gov.cms.bfd.server.war.commons.Profile; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.carin.C4BBAdjudication; import gov.cms.bfd.server.war.commons.carin.C4BBClaimInstitutionalCareTeamRole; import gov.cms.bfd.server.war.commons.carin.C4BBOrganizationIdentifierType; import gov.cms.bfd.server.war.commons.carin.C4BBPractitionerIdentifierType; import gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException; import java.util.Arrays; +import java.util.List; import java.util.Map; import java.util.Optional; +import org.hl7.fhir.r4.model.Coding; import org.hl7.fhir.r4.model.ExplanationOfBenefit; import org.hl7.fhir.r4.model.ExplanationOfBenefit.ItemComponent; import org.springframework.stereotype.Component; @@ -41,6 +45,9 @@ final class HospiceClaimTransformerV2 implements ClaimTransformerInterfaceV2 { private static final String METRIC_NAME = MetricRegistry.name(HospiceClaimTransformerV2.class.getSimpleName(), "transform"); + /** The securityTagManager. */ + private final SecurityTagManager securityTagManager; + /** * Instantiates a new transformer. * @@ -50,10 +57,15 @@ final class HospiceClaimTransformerV2 implements ClaimTransformerInterfaceV2 { * * @param metricRegistry the metric registry * @param npiOrgLookup the npi org lookup + * @param securityTagManager SamhsaSecurityTags lookup */ - public HospiceClaimTransformerV2(MetricRegistry metricRegistry, NPIOrgLookup npiOrgLookup) { + public HospiceClaimTransformerV2( + MetricRegistry metricRegistry, + NPIOrgLookup npiOrgLookup, + SecurityTagManager securityTagManager) { this.metricRegistry = requireNonNull(metricRegistry); this.npiOrgLookup = requireNonNull(npiOrgLookup); + this.securityTagManager = requireNonNull(securityTagManager); } /** @@ -71,7 +83,11 @@ public ExplanationOfBenefit transform(Object claim, boolean includeTaxNumber) { } ExplanationOfBenefit eob; try (Timer.Context ignored = metricRegistry.timer(METRIC_NAME).time()) { - eob = transformClaim((HospiceClaim) claim); + HospiceClaim hospiceClaim = (HospiceClaim) claim; + List securityTags = + securityTagManager.getClaimSecurityLevel( + String.valueOf(hospiceClaim.getClaimId()), HospiceTag.class); + eob = transformClaim(hospiceClaim, securityTags); } return eob; } @@ -80,14 +96,16 @@ public ExplanationOfBenefit transform(Object claim, boolean includeTaxNumber) { * Transforms a specified {@link HospiceClaim} into a FHIR {@link ExplanationOfBenefit}. * * @param claimGroup the CCW {@link HospiceClaim} to transform + * @param securityTags securityTags of the claim * @return a FHIR {@link ExplanationOfBenefit} resource that represents the specified {@link * HospiceClaim} */ - private ExplanationOfBenefit transformClaim(HospiceClaim claimGroup) { + private ExplanationOfBenefit transformClaim(HospiceClaim claimGroup, List securityTags) { ExplanationOfBenefit eob = new ExplanationOfBenefit(); // Required values not directly mapped eob.getMeta().addProfile(Profile.C4BB.getVersionedEobInpatientUrl()); + eob.getMeta().setSecurity(securityTags); // Common group level fields between all claim types // Claim Type + Claim ID => ExplanationOfBenefit.id diff --git a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/InpatientClaimTransformerV2.java b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/InpatientClaimTransformerV2.java index e188bf36dd..ee27dd6294 100644 --- a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/InpatientClaimTransformerV2.java +++ b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/InpatientClaimTransformerV2.java @@ -9,17 +9,20 @@ import gov.cms.bfd.model.codebook.data.CcwCodebookVariable; import gov.cms.bfd.model.rif.entities.InpatientClaim; import gov.cms.bfd.model.rif.entities.InpatientClaimLine; +import gov.cms.bfd.model.rif.samhsa.InpatientTag; import gov.cms.bfd.server.war.commons.C4BBInstutionalClaimSubtypes; import gov.cms.bfd.server.war.commons.CCWUtils; import gov.cms.bfd.server.war.commons.ClaimType; import gov.cms.bfd.server.war.commons.MedicareSegment; import gov.cms.bfd.server.war.commons.Profile; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.TransformerConstants; import gov.cms.bfd.server.war.commons.carin.C4BBClaimInstitutionalCareTeamRole; import gov.cms.bfd.server.war.commons.carin.C4BBOrganizationIdentifierType; import gov.cms.bfd.server.war.commons.carin.C4BBPractitionerIdentifierType; import gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException; import java.util.Arrays; +import java.util.List; import java.util.Optional; import org.hl7.fhir.r4.model.CodeableConcept; import org.hl7.fhir.r4.model.Coding; @@ -43,6 +46,9 @@ final class InpatientClaimTransformerV2 implements ClaimTransformerInterfaceV2 { private static final String METRIC_NAME = MetricRegistry.name(InpatientClaimTransformerV2.class.getSimpleName(), "transform"); + /** The securityTagManager. */ + private final SecurityTagManager securityTagManager; + /** * Instantiates a new transformer. * @@ -52,10 +58,15 @@ final class InpatientClaimTransformerV2 implements ClaimTransformerInterfaceV2 { * * @param metricRegistry the metric registry * @param npiOrgLookup the npi org lookup + * @param securityTagManager SamhsaSecurityTag lookup */ - public InpatientClaimTransformerV2(MetricRegistry metricRegistry, NPIOrgLookup npiOrgLookup) { + public InpatientClaimTransformerV2( + MetricRegistry metricRegistry, + NPIOrgLookup npiOrgLookup, + SecurityTagManager securityTagManager) { this.metricRegistry = requireNonNull(metricRegistry); this.npiOrgLookup = requireNonNull(npiOrgLookup); + this.securityTagManager = requireNonNull(securityTagManager); } /** @@ -74,7 +85,11 @@ public ExplanationOfBenefit transform(Object claim, boolean includeTaxNumber) { } ExplanationOfBenefit eob; try (Timer.Context ignored = metricRegistry.timer(METRIC_NAME).time()) { - eob = transformClaim((InpatientClaim) claim); + InpatientClaim inpatientClaim = (InpatientClaim) claim; + List securityTags = + securityTagManager.getClaimSecurityLevel( + String.valueOf(inpatientClaim.getClaimId()), InpatientTag.class); + eob = transformClaim(inpatientClaim, securityTags); } return eob; } @@ -83,14 +98,17 @@ public ExplanationOfBenefit transform(Object claim, boolean includeTaxNumber) { * Transforms a specified {@link InpatientClaim} into a FHIR {@link ExplanationOfBenefit}. * * @param claimGroup the CCW {@link InpatientClaim} to transform + * @param securityTags securityTags of the claim * @return a FHIR {@link ExplanationOfBenefit} resource that represents the specified {@link * InpatientClaim} */ - private ExplanationOfBenefit transformClaim(InpatientClaim claimGroup) { + private ExplanationOfBenefit transformClaim( + InpatientClaim claimGroup, List securityTags) { ExplanationOfBenefit eob = new ExplanationOfBenefit(); // Required values not directly mapped eob.getMeta().addProfile(Profile.C4BB.getVersionedEobInpatientUrl()); + eob.getMeta().setSecurity(securityTags); // Common group level fields between all claim types // Claim Type + Claim ID => ExplanationOfBenefit.id diff --git a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/OutpatientClaimTransformerV2.java b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/OutpatientClaimTransformerV2.java index db8b2a9303..b2dda26063 100644 --- a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/OutpatientClaimTransformerV2.java +++ b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/OutpatientClaimTransformerV2.java @@ -11,18 +11,22 @@ import gov.cms.bfd.model.rif.entities.InpatientClaim; import gov.cms.bfd.model.rif.entities.OutpatientClaim; import gov.cms.bfd.model.rif.entities.OutpatientClaimLine; +import gov.cms.bfd.model.rif.samhsa.OutpatientTag; import gov.cms.bfd.server.war.commons.C4BBInstutionalClaimSubtypes; import gov.cms.bfd.server.war.commons.ClaimType; import gov.cms.bfd.server.war.commons.MedicareSegment; import gov.cms.bfd.server.war.commons.Profile; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.carin.C4BBAdjudication; import gov.cms.bfd.server.war.commons.carin.C4BBClaimInstitutionalCareTeamRole; import gov.cms.bfd.server.war.commons.carin.C4BBOrganizationIdentifierType; import gov.cms.bfd.server.war.commons.carin.C4BBPractitionerIdentifierType; import gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException; import java.util.Arrays; +import java.util.List; import java.util.Map; import java.util.Optional; +import org.hl7.fhir.r4.model.Coding; import org.hl7.fhir.r4.model.ExplanationOfBenefit; import org.hl7.fhir.r4.model.ExplanationOfBenefit.ItemComponent; import org.springframework.stereotype.Component; @@ -47,6 +51,9 @@ final class OutpatientClaimTransformerV2 implements ClaimTransformerInterfaceV2 private static final String METRIC_NAME = MetricRegistry.name(OutpatientClaimTransformerV2.class.getSimpleName(), "transform"); + /** The securityTagManager. */ + private final SecurityTagManager securityTagManager; + /** * Instantiates a new transformer. * @@ -57,14 +64,17 @@ final class OutpatientClaimTransformerV2 implements ClaimTransformerInterfaceV2 * @param metricRegistry the metric registry * @param drugCodeDisplayLookup the drug code display lookup * @param npiOrgLookup the npi org lookup + * @param securityTagManager SamhsaSecurityTags lookup */ public OutpatientClaimTransformerV2( MetricRegistry metricRegistry, FdaDrugCodeDisplayLookup drugCodeDisplayLookup, - NPIOrgLookup npiOrgLookup) { + NPIOrgLookup npiOrgLookup, + SecurityTagManager securityTagManager) { this.metricRegistry = requireNonNull(metricRegistry); this.npiOrgLookup = requireNonNull(npiOrgLookup); this.drugCodeDisplayLookup = requireNonNull(drugCodeDisplayLookup); + this.securityTagManager = requireNonNull(securityTagManager); } /** @@ -83,7 +93,12 @@ public ExplanationOfBenefit transform(Object claim, boolean includeTaxNumber) { } ExplanationOfBenefit eob; try (Timer.Context ignored = metricRegistry.timer(METRIC_NAME).time()) { - eob = transformClaim((OutpatientClaim) claim); + + OutpatientClaim outpatientClaim = (OutpatientClaim) claim; + List securityTags = + securityTagManager.getClaimSecurityLevel( + String.valueOf(outpatientClaim.getClaimId()), OutpatientTag.class); + eob = transformClaim(outpatientClaim, securityTags); } return eob; } @@ -92,14 +107,17 @@ public ExplanationOfBenefit transform(Object claim, boolean includeTaxNumber) { * Transforms a specified {@link InpatientClaim} into a FHIR {@link ExplanationOfBenefit}. * * @param claimGroup the CCW {@link InpatientClaim} to transform + * @param securityTags securityTags of the claim * @return a FHIR {@link ExplanationOfBenefit} resource that represents the specified {@link * OutpatientClaim} */ - private ExplanationOfBenefit transformClaim(OutpatientClaim claimGroup) { + private ExplanationOfBenefit transformClaim( + OutpatientClaim claimGroup, List securityTags) { ExplanationOfBenefit eob = new ExplanationOfBenefit(); // Required values not directly mapped eob.getMeta().addProfile(Profile.C4BB.getVersionedEobOutpatientUrl()); + eob.getMeta().setSecurity(securityTags); // Common group level fields between all claim types // Claim Type + Claim ID => ExplanationOfBenefit.id diff --git a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/SNFClaimTransformerV2.java b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/SNFClaimTransformerV2.java index e15f9830a2..a101bfa111 100644 --- a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/SNFClaimTransformerV2.java +++ b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/SNFClaimTransformerV2.java @@ -10,19 +10,23 @@ import gov.cms.bfd.model.codebook.data.CcwCodebookVariable; import gov.cms.bfd.model.rif.entities.SNFClaim; import gov.cms.bfd.model.rif.entities.SNFClaimLine; +import gov.cms.bfd.model.rif.samhsa.SnfTag; import gov.cms.bfd.server.war.commons.C4BBInstutionalClaimSubtypes; import gov.cms.bfd.server.war.commons.ClaimType; import gov.cms.bfd.server.war.commons.CommonTransformerUtils; import gov.cms.bfd.server.war.commons.MedicareSegment; import gov.cms.bfd.server.war.commons.Profile; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.carin.C4BBClaimInstitutionalCareTeamRole; import gov.cms.bfd.server.war.commons.carin.C4BBOrganizationIdentifierType; import gov.cms.bfd.server.war.commons.carin.C4BBPractitionerIdentifierType; import gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException; import java.math.BigDecimal; import java.util.Collections; +import java.util.List; import java.util.Map; import java.util.Optional; +import org.hl7.fhir.r4.model.Coding; import org.hl7.fhir.r4.model.ExplanationOfBenefit; import org.hl7.fhir.r4.model.ExplanationOfBenefit.ItemComponent; import org.hl7.fhir.r4.model.Period; @@ -42,6 +46,9 @@ public class SNFClaimTransformerV2 implements ClaimTransformerInterfaceV2 { private static final String METRIC_NAME = MetricRegistry.name(SNFClaimTransformerV2.class.getSimpleName(), "transform"); + /** The securityTagManager. */ + private final SecurityTagManager securityTagManager; + /** * Instantiates a new transformer. * @@ -51,10 +58,15 @@ public class SNFClaimTransformerV2 implements ClaimTransformerInterfaceV2 { * * @param metricRegistry the metric registry * @param npiOrgLookup the npi org lookup + * @param securityTagManager SamhsaSecurityTags lookup */ - public SNFClaimTransformerV2(MetricRegistry metricRegistry, NPIOrgLookup npiOrgLookup) { + public SNFClaimTransformerV2( + MetricRegistry metricRegistry, + NPIOrgLookup npiOrgLookup, + SecurityTagManager securityTagManager) { this.metricRegistry = requireNonNull(metricRegistry); this.npiOrgLookup = requireNonNull(npiOrgLookup); + this.securityTagManager = requireNonNull(securityTagManager); } /** @@ -73,7 +85,11 @@ public ExplanationOfBenefit transform(Object claim, boolean includeTaxNumber) { } ExplanationOfBenefit eob; try (Timer.Context ignored = metricRegistry.timer(METRIC_NAME).time()) { - eob = transformClaim((SNFClaim) claim); + SNFClaim snfClaim = (SNFClaim) claim; + List securityTags = + securityTagManager.getClaimSecurityLevel( + String.valueOf(snfClaim.getClaimId()), SnfTag.class); + eob = transformClaim(snfClaim, securityTags); } return eob; } @@ -82,14 +98,16 @@ public ExplanationOfBenefit transform(Object claim, boolean includeTaxNumber) { * Transforms a specified {@link SNFClaim} into a FHIR {@link ExplanationOfBenefit}. * * @param claimGroup the CCW {@link SNFClaim} to transform + * @param securityTags securityTags of the claim * @return a FHIR {@link ExplanationOfBenefit} resource that represents the specified {@link * SNFClaim} */ - private ExplanationOfBenefit transformClaim(SNFClaim claimGroup) { + private ExplanationOfBenefit transformClaim(SNFClaim claimGroup, List securityTags) { ExplanationOfBenefit eob = new ExplanationOfBenefit(); // Required values not directly mapped eob.getMeta().addProfile(Profile.C4BB.getVersionedEobInpatientUrl()); + eob.getMeta().setSecurity(securityTags); // Common group level fields between all claim types // Claim Type + Claim ID => ExplanationOfBenefit.id diff --git a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/pac/FissClaimResponseTransformerV2.java b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/pac/FissClaimResponseTransformerV2.java index 8133343d6b..76f64a8581 100644 --- a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/pac/FissClaimResponseTransformerV2.java +++ b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/pac/FissClaimResponseTransformerV2.java @@ -7,7 +7,9 @@ import com.newrelic.api.agent.Trace; import gov.cms.bfd.model.rda.entities.RdaFissClaim; import gov.cms.bfd.model.rda.entities.RdaFissRevenueLine; +import gov.cms.bfd.model.rda.samhsa.FissTag; import gov.cms.bfd.server.war.commons.BBCodingSystems; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.carin.C4BBAdjudicationDiscriminator; import gov.cms.bfd.server.war.r4.providers.pac.common.AbstractTransformerV2; import gov.cms.bfd.server.war.r4.providers.pac.common.FissTransformerV2; @@ -41,6 +43,9 @@ public class FissClaimResponseTransformerV2 extends AbstractTransformerV2 private static final String METRIC_NAME = MetricRegistry.name(FissClaimResponseTransformerV2.class.getSimpleName(), "transform"); + /** The securityTagManager. */ + private final SecurityTagManager securityTagManager; + /** * The known FISS status codes and their associated {@link ClaimResponse.RemittanceOutcome} * mappings. @@ -67,10 +72,13 @@ public class FissClaimResponseTransformerV2 extends AbstractTransformerV2 * called by tests. * * @param metricRegistry the metric registry + * @param securityTagManager the security tag manager */ - public FissClaimResponseTransformerV2(MetricRegistry metricRegistry) { + public FissClaimResponseTransformerV2( + MetricRegistry metricRegistry, SecurityTagManager securityTagManager) { requireNonNull(metricRegistry); this.metricRegistry = metricRegistry; + this.securityTagManager = securityTagManager; } /** @@ -87,7 +95,10 @@ public ClaimResponse transform(Object claimEntity, boolean includeTaxNumbers) { } try (Timer.Context ignored = metricRegistry.timer(METRIC_NAME).time()) { - return transformClaim((RdaFissClaim) claimEntity); + RdaFissClaim rdaFissClaim = (RdaFissClaim) claimEntity; + List securityTags = + securityTagManager.getClaimSecurityLevel(rdaFissClaim.getClaimId(), FissTag.class); + return transformClaim(rdaFissClaim, securityTags); } } @@ -95,10 +106,11 @@ public ClaimResponse transform(Object claimEntity, boolean includeTaxNumbers) { * Transforms an {@link RdaFissClaim} to a FHIR {@link ClaimResponse}. * * @param claimGroup the {@link RdaFissClaim} to transform + * @param securityTags securityTags of the claim * @return a FHIR {@link ClaimResponse} resource that represents the specified {@link * RdaFissClaim} */ - private ClaimResponse transformClaim(RdaFissClaim claimGroup) { + private ClaimResponse transformClaim(RdaFissClaim claimGroup, List securityTags) { ClaimResponse claim = new ClaimResponse(); claim.setId("f-" + claimGroup.getClaimId()); @@ -114,7 +126,11 @@ private ClaimResponse transformClaim(RdaFissClaim claimGroup) { claim.setRequest(new Reference(String.format("Claim/f-%s", claimGroup.getClaimId()))); claim.setItem(getClaimItems(claimGroup)); - claim.setMeta(new Meta().setLastUpdated(Date.from(claimGroup.getLastUpdated()))); + // Add the Coding to the list + Meta meta = + new Meta().setSecurity(securityTags).setLastUpdated(Date.from(claimGroup.getLastUpdated())); + + claim.setMeta(meta); claim.setCreated(new Date()); return claim; diff --git a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/pac/FissClaimTransformerV2.java b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/pac/FissClaimTransformerV2.java index ed25704d30..d4f0c56fda 100644 --- a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/pac/FissClaimTransformerV2.java +++ b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/pac/FissClaimTransformerV2.java @@ -11,9 +11,11 @@ import gov.cms.bfd.model.rda.entities.RdaFissPayer; import gov.cms.bfd.model.rda.entities.RdaFissProcCode; import gov.cms.bfd.model.rda.entities.RdaFissRevenueLine; +import gov.cms.bfd.model.rda.samhsa.FissTag; import gov.cms.bfd.server.war.commons.BBCodingSystems; import gov.cms.bfd.server.war.commons.CCWUtils; import gov.cms.bfd.server.war.commons.IcdCode; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.TransformerConstants; import gov.cms.bfd.server.war.commons.carin.C4BBOrganizationIdentifierType; import gov.cms.bfd.server.war.commons.carin.C4BBSupportingInfoType; @@ -62,6 +64,9 @@ public class FissClaimTransformerV2 extends AbstractTransformerV2 /** The Metric registry. */ private final MetricRegistry metricRegistry; + /** The securityTagManager. */ + private final SecurityTagManager securityTagManager; + /** The METRIC_NAME constant. */ private static final String METRIC_NAME = MetricRegistry.name(FissClaimTransformerV2.class.getSimpleName(), "transform"); @@ -74,9 +79,12 @@ public class FissClaimTransformerV2 extends AbstractTransformerV2 * called by tests. * * @param metricRegistry the metric registry + * @param securityTagManager SamhsaSecurityTags lookup */ - public FissClaimTransformerV2(MetricRegistry metricRegistry) { + public FissClaimTransformerV2( + MetricRegistry metricRegistry, SecurityTagManager securityTagManager) { this.metricRegistry = requireNonNull(metricRegistry); + this.securityTagManager = requireNonNull(securityTagManager); } /** @@ -93,7 +101,10 @@ public Claim transform(Object claimEntity, boolean includeTaxNumbers) { } try (Timer.Context ignored = metricRegistry.timer(METRIC_NAME).time()) { - return transformClaim((RdaFissClaim) claimEntity, includeTaxNumbers); + RdaFissClaim rdaFissClaim = (RdaFissClaim) claimEntity; + List securityTags = + securityTagManager.getClaimSecurityLevel(rdaFissClaim.getClaimId(), FissTag.class); + return transformClaim(rdaFissClaim, includeTaxNumbers, securityTags); } } @@ -102,9 +113,11 @@ public Claim transform(Object claimEntity, boolean includeTaxNumbers) { * * @param claimGroup the {@link RdaFissClaim} to transform * @param includeTaxNumbers Indicates if tax numbers should be included in the results + * @param securityTags securityTags of the claim * @return a FHIR {@link Claim} resource that represents the specified {@link RdaFissClaim} */ - private Claim transformClaim(RdaFissClaim claimGroup, boolean includeTaxNumbers) { + private Claim transformClaim( + RdaFissClaim claimGroup, boolean includeTaxNumbers, List securityTags) { Claim claim = new Claim(); boolean isIcd9 = @@ -135,7 +148,9 @@ private Claim transformClaim(RdaFissClaim claimGroup, boolean includeTaxNumbers) claim.setInsurance(getInsurance(claimGroup)); claim.setItem(getClaimItems(claimGroup)); - claim.setMeta(new Meta().setLastUpdated(Date.from(claimGroup.getLastUpdated()))); + Meta meta = + new Meta().setSecurity(securityTags).setLastUpdated(Date.from(claimGroup.getLastUpdated())); + claim.setMeta(meta); claim.setCreated(new Date()); return claim; diff --git a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/pac/McsClaimResponseTransformerV2.java b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/pac/McsClaimResponseTransformerV2.java index f952c18494..69dfffd695 100644 --- a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/pac/McsClaimResponseTransformerV2.java +++ b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/pac/McsClaimResponseTransformerV2.java @@ -5,7 +5,9 @@ import com.google.common.base.Strings; import com.newrelic.api.agent.Trace; import gov.cms.bfd.model.rda.entities.RdaMcsClaim; +import gov.cms.bfd.model.rda.samhsa.McsTag; import gov.cms.bfd.server.war.commons.BBCodingSystems; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.r4.providers.pac.common.AbstractTransformerV2; import gov.cms.bfd.server.war.r4.providers.pac.common.McsTransformerV2; import gov.cms.bfd.server.war.r4.providers.pac.common.ResourceTransformer; @@ -16,6 +18,7 @@ import java.util.Map; import org.hl7.fhir.r4.model.Claim; import org.hl7.fhir.r4.model.ClaimResponse; +import org.hl7.fhir.r4.model.Coding; import org.hl7.fhir.r4.model.Extension; import org.hl7.fhir.r4.model.Identifier; import org.hl7.fhir.r4.model.Meta; @@ -35,6 +38,9 @@ public class McsClaimResponseTransformerV2 extends AbstractTransformerV2 private static final String METRIC_NAME = MetricRegistry.name(McsClaimResponseTransformerV2.class.getSimpleName(), "transform"); + /** The securityTagManager. */ + private final SecurityTagManager securityTagManager; + /** * There are only 2 statuses currently being used, and only the ones listed below are mapped to * "CANCELLED". For brevity, the rest are defaulted to "ACTIVE" using {@link @@ -82,9 +88,12 @@ public class McsClaimResponseTransformerV2 extends AbstractTransformerV2 * Instantiates a new Mcs claim response transformer v2. @param metricRegistry the metric registry * * @param metricRegistry the metric registry + * @param securityTagManager the security tag manager */ - public McsClaimResponseTransformerV2(MetricRegistry metricRegistry) { + public McsClaimResponseTransformerV2( + MetricRegistry metricRegistry, SecurityTagManager securityTagManager) { this.metricRegistry = metricRegistry; + this.securityTagManager = securityTagManager; } /** @@ -101,7 +110,10 @@ public ClaimResponse transform(Object claimEntity, boolean includeTaxNumbers) { } try (Timer.Context ignored = metricRegistry.timer(METRIC_NAME).time()) { - return transformClaim((RdaMcsClaim) claimEntity); + RdaMcsClaim rdaMcsClaim = (RdaMcsClaim) claimEntity; + List securityTags = + securityTagManager.getClaimSecurityLevel(rdaMcsClaim.getIdrClmHdIcn(), McsTag.class); + return transformClaim(rdaMcsClaim, securityTags); } } @@ -109,9 +121,10 @@ public ClaimResponse transform(Object claimEntity, boolean includeTaxNumbers) { * Transforms a {@link RdaMcsClaim} into a FHIR {@link Claim}. * * @param claimGroup the {@link RdaMcsClaim} to transform + * @param securityTags securityTags of the claim * @return a FHIR {@link ClaimResponse} resource that represents the specified {@link RdaMcsClaim} */ - private ClaimResponse transformClaim(RdaMcsClaim claimGroup) { + private ClaimResponse transformClaim(RdaMcsClaim claimGroup, List securityTags) { ClaimResponse claim = new ClaimResponse(); claim.setId("m-" + claimGroup.getIdrClmHdIcn()); @@ -128,7 +141,9 @@ private ClaimResponse transformClaim(RdaMcsClaim claimGroup) { claim.setPatient(new Reference("#patient")); claim.setRequest(new Reference(String.format("Claim/m-%s", claimGroup.getIdrClmHdIcn()))); - claim.setMeta(new Meta().setLastUpdated(Date.from(claimGroup.getLastUpdated()))); + Meta meta = + new Meta().setSecurity(securityTags).setLastUpdated(Date.from(claimGroup.getLastUpdated())); + claim.setMeta(meta); claim.setCreated(new Date()); return claim; diff --git a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/pac/McsClaimTransformerV2.java b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/pac/McsClaimTransformerV2.java index 3a42d2cef3..4ac1b9b8d2 100644 --- a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/pac/McsClaimTransformerV2.java +++ b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/r4/providers/pac/McsClaimTransformerV2.java @@ -1,13 +1,17 @@ package gov.cms.bfd.server.war.r4.providers.pac; +import static java.util.Objects.requireNonNull; + import com.codahale.metrics.MetricRegistry; import com.codahale.metrics.Timer; import com.newrelic.api.agent.Trace; import gov.cms.bfd.model.rda.entities.RdaMcsClaim; import gov.cms.bfd.model.rda.entities.RdaMcsDetail; import gov.cms.bfd.model.rda.entities.RdaMcsDiagnosisCode; +import gov.cms.bfd.model.rda.samhsa.McsTag; import gov.cms.bfd.server.war.commons.BBCodingSystems; import gov.cms.bfd.server.war.commons.IcdCode; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.TransformerConstants; import gov.cms.bfd.server.war.r4.providers.pac.common.AbstractTransformerV2; import gov.cms.bfd.server.war.r4.providers.pac.common.McsTransformerV2; @@ -44,6 +48,9 @@ public class McsClaimTransformerV2 extends AbstractTransformerV2 implements ResourceTransformer { + /** The securityTagManager. */ + private final SecurityTagManager securityTagManager; + /** The metric name. */ private static final String METRIC_NAME = MetricRegistry.name(McsClaimResponseTransformerV2.class.getSimpleName(), "transform"); @@ -72,9 +79,12 @@ public class McsClaimTransformerV2 extends AbstractTransformerV2 * called by tests. * * @param metricRegistry the metric registry + * @param securityTagManager SamhsaSecurityTags lookup */ - public McsClaimTransformerV2(MetricRegistry metricRegistry) { + public McsClaimTransformerV2( + MetricRegistry metricRegistry, SecurityTagManager securityTagManager) { this.metricRegistry = metricRegistry; + this.securityTagManager = requireNonNull(securityTagManager); } /** @@ -92,7 +102,10 @@ public Claim transform(Object claimEntity, boolean includeTaxNumbers) { } try (Timer.Context ignored = metricRegistry.timer(METRIC_NAME).time()) { - return transformClaim((RdaMcsClaim) claimEntity, includeTaxNumbers); + RdaMcsClaim claim = (RdaMcsClaim) claimEntity; + List securityTags = + securityTagManager.getClaimSecurityLevel(claim.getIdrClmHdIcn(), McsTag.class); + return transformClaim(claim, includeTaxNumbers, securityTags); } } @@ -101,9 +114,11 @@ public Claim transform(Object claimEntity, boolean includeTaxNumbers) { * * @param claimGroup the {@link RdaMcsClaim} to transform * @param includeTaxNumbers Indicates if tax numbers should be included in the results + * @param securityTags securityTags tag of a claim * @return a FHIR {@link Claim} resource that represents the specified {@link RdaMcsClaim} */ - private Claim transformClaim(RdaMcsClaim claimGroup, boolean includeTaxNumbers) { + private Claim transformClaim( + RdaMcsClaim claimGroup, boolean includeTaxNumbers, List securityTags) { Claim claim = new Claim(); claim.setId("m-" + claimGroup.getIdrClmHdIcn()); @@ -129,8 +144,10 @@ private Claim transformClaim(RdaMcsClaim claimGroup, boolean includeTaxNumbers) claim.setItem(getItems(claimGroup)); claim.setCreated(new Date()); - claim.setMeta(new Meta().setLastUpdated(Date.from(claimGroup.getLastUpdated()))); + Meta meta = + new Meta().setSecurity(securityTags).setLastUpdated(Date.from(claimGroup.getLastUpdated())); + claim.setMeta(meta); return claim; } diff --git a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/stu3/providers/CarrierClaimTransformer.java b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/stu3/providers/CarrierClaimTransformer.java index b9ab773ff8..b7446323b2 100644 --- a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/stu3/providers/CarrierClaimTransformer.java +++ b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/stu3/providers/CarrierClaimTransformer.java @@ -11,15 +11,19 @@ import gov.cms.bfd.model.codebook.data.CcwCodebookVariable; import gov.cms.bfd.model.rif.entities.CarrierClaim; import gov.cms.bfd.model.rif.entities.CarrierClaimLine; +import gov.cms.bfd.model.rif.samhsa.CarrierTag; import gov.cms.bfd.server.war.commons.ClaimType; import gov.cms.bfd.server.war.commons.IdentifierType; import gov.cms.bfd.server.war.commons.MedicareSegment; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.TransformerConstants; import gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException; import java.math.BigDecimal; import java.util.Arrays; +import java.util.List; import java.util.Map; import java.util.Optional; +import org.hl7.fhir.dstu3.model.Coding; import org.hl7.fhir.dstu3.model.ExplanationOfBenefit; import org.hl7.fhir.dstu3.model.ExplanationOfBenefit.ItemComponent; import org.hl7.fhir.dstu3.model.codesystems.ClaimCareteamrole; @@ -42,6 +46,9 @@ final class CarrierClaimTransformer implements ClaimTransformerInterface { private static final String METRIC_NAME = MetricRegistry.name(CarrierClaimTransformer.class.getSimpleName(), "transform"); + /** The securityTagManager. */ + private final SecurityTagManager securityTagManager; + /** * Instantiates a new transformer. * @@ -52,14 +59,17 @@ final class CarrierClaimTransformer implements ClaimTransformerInterface { * @param metricRegistry the metric registry * @param drugCodeDisplayLookup the drug code display lookup * @param npiOrgLookup the npi org lookup + * @param securityTagManager SamhsaSecurityTags lookup */ public CarrierClaimTransformer( MetricRegistry metricRegistry, FdaDrugCodeDisplayLookup drugCodeDisplayLookup, - NPIOrgLookup npiOrgLookup) { + NPIOrgLookup npiOrgLookup, + SecurityTagManager securityTagManager) { this.metricRegistry = requireNonNull(metricRegistry); this.npiOrgLookup = requireNonNull(npiOrgLookup); this.drugCodeDisplayLookup = requireNonNull(drugCodeDisplayLookup); + this.securityTagManager = requireNonNull(securityTagManager); } /** @@ -77,7 +87,11 @@ public ExplanationOfBenefit transform(Object claim, boolean includeTaxNumber) { } ExplanationOfBenefit eob; try (Timer.Context ignored = metricRegistry.timer(METRIC_NAME).time()) { - eob = transformClaim((CarrierClaim) claim, includeTaxNumber); + CarrierClaim carrierClaim = (CarrierClaim) claim; + List securityTags = + securityTagManager.getClaimSecurityLevelDstu3( + String.valueOf(carrierClaim.getClaimId()), CarrierTag.class); + eob = transformClaim(carrierClaim, includeTaxNumber, securityTags); } return eob; } @@ -87,10 +101,12 @@ public ExplanationOfBenefit transform(Object claim, boolean includeTaxNumber) { * * @param claimGroup the CCW {@link CarrierClaim} to transform * @param includeTaxNumbers whether to include tax numbers in the response + * @param securityTags securityTags of a claim * @return a FHIR {@link ExplanationOfBenefit} resource that represents the specified {@link * CarrierClaim} */ - private ExplanationOfBenefit transformClaim(CarrierClaim claimGroup, boolean includeTaxNumbers) { + private ExplanationOfBenefit transformClaim( + CarrierClaim claimGroup, boolean includeTaxNumbers, List securityTags) { ExplanationOfBenefit eob = new ExplanationOfBenefit(); // Common group level fields between all claim types @@ -314,6 +330,8 @@ private ExplanationOfBenefit transformClaim(CarrierClaim claimGroup, boolean inc } TransformerUtils.setLastUpdated(eob, claimGroup.getLastUpdated()); + + eob.getMeta().setSecurity(securityTags); return eob; } } diff --git a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/stu3/providers/DMEClaimTransformer.java b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/stu3/providers/DMEClaimTransformer.java index 6a73b9d83d..e2c6447002 100644 --- a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/stu3/providers/DMEClaimTransformer.java +++ b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/stu3/providers/DMEClaimTransformer.java @@ -9,14 +9,18 @@ import gov.cms.bfd.model.codebook.data.CcwCodebookVariable; import gov.cms.bfd.model.rif.entities.DMEClaim; import gov.cms.bfd.model.rif.entities.DMEClaimLine; +import gov.cms.bfd.model.rif.samhsa.DmeTag; import gov.cms.bfd.server.war.commons.ClaimType; import gov.cms.bfd.server.war.commons.IdentifierType; import gov.cms.bfd.server.war.commons.MedicareSegment; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.TransformerConstants; import gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException; import java.util.Arrays; +import java.util.List; import java.util.Map; import java.util.Optional; +import org.hl7.fhir.dstu3.model.Coding; import org.hl7.fhir.dstu3.model.ExplanationOfBenefit; import org.hl7.fhir.dstu3.model.ExplanationOfBenefit.ItemComponent; import org.hl7.fhir.dstu3.model.Extension; @@ -38,6 +42,9 @@ final class DMEClaimTransformer implements ClaimTransformerInterface { private static final String METRIC_NAME = MetricRegistry.name(DMEClaimTransformer.class.getSimpleName(), "transform"); + /** The securityTagManager. */ + private final SecurityTagManager securityTagManager; + /** * Instantiates a new transformer. * @@ -47,11 +54,15 @@ final class DMEClaimTransformer implements ClaimTransformerInterface { * * @param metricRegistry the metric registry * @param drugCodeDisplayLookup the drug code display lookup + * @param securityTagManager SamhsaSecurityTag lookup */ public DMEClaimTransformer( - MetricRegistry metricRegistry, FdaDrugCodeDisplayLookup drugCodeDisplayLookup) { + MetricRegistry metricRegistry, + FdaDrugCodeDisplayLookup drugCodeDisplayLookup, + SecurityTagManager securityTagManager) { this.metricRegistry = requireNonNull(metricRegistry); this.drugCodeDisplayLookup = requireNonNull(drugCodeDisplayLookup); + this.securityTagManager = requireNonNull(securityTagManager); } /** @@ -69,7 +80,11 @@ public ExplanationOfBenefit transform(Object claim, boolean includeTaxNumber) { } ExplanationOfBenefit eob; try (Timer.Context ignored = metricRegistry.timer(METRIC_NAME).time()) { - eob = transformClaim((DMEClaim) claim, includeTaxNumber); + DMEClaim dmeClaim = (DMEClaim) claim; + List securityTags = + securityTagManager.getClaimSecurityLevelDstu3( + String.valueOf(dmeClaim.getClaimId()), DmeTag.class); + eob = transformClaim(dmeClaim, includeTaxNumber, securityTags); } return eob; } @@ -79,10 +94,12 @@ public ExplanationOfBenefit transform(Object claim, boolean includeTaxNumber) { * * @param claimGroup the {@link DMEClaim} to use * @param includeTaxNumbers whether to include tax numbers in the transformed EOB + * @param securityTags securityTags of a claim * @return a FHIR {@link ExplanationOfBenefit} resource that represents the specified {@link * DMEClaim} */ - private ExplanationOfBenefit transformClaim(DMEClaim claimGroup, boolean includeTaxNumbers) { + private ExplanationOfBenefit transformClaim( + DMEClaim claimGroup, boolean includeTaxNumbers, List securityTags) { ExplanationOfBenefit eob = new ExplanationOfBenefit(); // Common group level fields between all claim types @@ -303,6 +320,9 @@ private ExplanationOfBenefit transformClaim(DMEClaim claimGroup, boolean include } } TransformerUtils.setLastUpdated(eob, claimGroup.getLastUpdated()); + + eob.getMeta().setSecurity(securityTags); + return eob; } } diff --git a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/stu3/providers/HHAClaimTransformer.java b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/stu3/providers/HHAClaimTransformer.java index 45b16c161a..b8dbe48c19 100644 --- a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/stu3/providers/HHAClaimTransformer.java +++ b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/stu3/providers/HHAClaimTransformer.java @@ -10,13 +10,17 @@ import gov.cms.bfd.model.rif.entities.HHAClaim; import gov.cms.bfd.model.rif.entities.HHAClaimLine; import gov.cms.bfd.model.rif.entities.OutpatientClaim; +import gov.cms.bfd.model.rif.samhsa.HhaTag; import gov.cms.bfd.server.war.commons.ClaimType; import gov.cms.bfd.server.war.commons.MedicareSegment; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException; import java.util.Arrays; +import java.util.List; import java.util.Map; import java.util.Optional; import org.hl7.fhir.dstu3.model.Address; +import org.hl7.fhir.dstu3.model.Coding; import org.hl7.fhir.dstu3.model.ExplanationOfBenefit; import org.hl7.fhir.dstu3.model.ExplanationOfBenefit.BenefitComponent; import org.hl7.fhir.dstu3.model.ExplanationOfBenefit.ItemComponent; @@ -37,6 +41,9 @@ final class HHAClaimTransformer implements ClaimTransformerInterface { private static final String METRIC_NAME = MetricRegistry.name(HHAClaimTransformer.class.getSimpleName(), "transform"); + /** The securityTagManager. */ + private final SecurityTagManager securityTagManager; + /** * Instantiates a new transformer. * @@ -46,10 +53,15 @@ final class HHAClaimTransformer implements ClaimTransformerInterface { * * @param metricRegistry the metric registry * @param npiOrgLookup the npi org lookup + * @param securityTagManager SamhsaSecurityTags lookup */ - public HHAClaimTransformer(MetricRegistry metricRegistry, NPIOrgLookup npiOrgLookup) { + public HHAClaimTransformer( + MetricRegistry metricRegistry, + NPIOrgLookup npiOrgLookup, + SecurityTagManager securityTagManager) { this.metricRegistry = requireNonNull(metricRegistry); this.npiOrgLookup = requireNonNull(npiOrgLookup); + this.securityTagManager = requireNonNull(securityTagManager); } /** @@ -67,7 +79,11 @@ public ExplanationOfBenefit transform(Object claim, boolean includeTaxNumber) { } ExplanationOfBenefit eob; try (Timer.Context ignored = metricRegistry.timer(METRIC_NAME).time()) { - eob = transformClaim((HHAClaim) claim); + HHAClaim hhaClaim = (HHAClaim) claim; + List securityTags = + securityTagManager.getClaimSecurityLevelDstu3( + String.valueOf(hhaClaim.getClaimId()), HhaTag.class); + eob = transformClaim(hhaClaim, securityTags); } return eob; } @@ -76,10 +92,11 @@ public ExplanationOfBenefit transform(Object claim, boolean includeTaxNumber) { * Transforms a specified {@link HHAClaim} into a FHIR {@link ExplanationOfBenefit}. * * @param claimGroup the CCW {@link HHAClaim} to transform + * @param securityTags securityTags tag of a claim * @return a FHIR {@link ExplanationOfBenefit} resource that represents the specified {@link * HHAClaim} */ - private ExplanationOfBenefit transformClaim(HHAClaim claimGroup) { + private ExplanationOfBenefit transformClaim(HHAClaim claimGroup, List securityTags) { ExplanationOfBenefit eob = new ExplanationOfBenefit(); // Common group level fields between all claim types @@ -197,6 +214,8 @@ private ExplanationOfBenefit transformClaim(HHAClaim claimGroup) { } TransformerUtils.setLastUpdated(eob, claimGroup.getLastUpdated()); + + eob.getMeta().setSecurity(securityTags); return eob; } } diff --git a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/stu3/providers/HospiceClaimTransformer.java b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/stu3/providers/HospiceClaimTransformer.java index 529ea9e2ed..eaed315a0d 100644 --- a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/stu3/providers/HospiceClaimTransformer.java +++ b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/stu3/providers/HospiceClaimTransformer.java @@ -9,13 +9,17 @@ import gov.cms.bfd.model.codebook.data.CcwCodebookVariable; import gov.cms.bfd.model.rif.entities.HospiceClaim; import gov.cms.bfd.model.rif.entities.HospiceClaimLine; +import gov.cms.bfd.model.rif.samhsa.HospiceTag; import gov.cms.bfd.server.war.commons.ClaimType; import gov.cms.bfd.server.war.commons.MedicareSegment; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException; import java.util.Arrays; +import java.util.List; import java.util.Map; import java.util.Optional; import org.hl7.fhir.dstu3.model.Address; +import org.hl7.fhir.dstu3.model.Coding; import org.hl7.fhir.dstu3.model.ExplanationOfBenefit; import org.hl7.fhir.dstu3.model.ExplanationOfBenefit.ItemComponent; import org.springframework.stereotype.Component; @@ -35,6 +39,9 @@ final class HospiceClaimTransformer implements ClaimTransformerInterface { private static final String METRIC_NAME = MetricRegistry.name(HospiceClaimTransformer.class.getSimpleName(), "transform"); + /** The securityTagManager. */ + private final SecurityTagManager securityTagManager; + /** * Instantiates a new transformer. * @@ -44,10 +51,15 @@ final class HospiceClaimTransformer implements ClaimTransformerInterface { * * @param metricRegistry the metric registry * @param npiOrgLookup the npi org lookup + * @param securityTagManager securityTagManager */ - public HospiceClaimTransformer(MetricRegistry metricRegistry, NPIOrgLookup npiOrgLookup) { + public HospiceClaimTransformer( + MetricRegistry metricRegistry, + NPIOrgLookup npiOrgLookup, + SecurityTagManager securityTagManager) { this.metricRegistry = requireNonNull(metricRegistry); this.npiOrgLookup = requireNonNull(npiOrgLookup); + this.securityTagManager = requireNonNull(securityTagManager); } /** @@ -65,7 +77,11 @@ public ExplanationOfBenefit transform(Object claim, boolean includeTaxNumber) { } ExplanationOfBenefit eob; try (Timer.Context ignored = metricRegistry.timer(METRIC_NAME).time()) { - eob = transformClaim((HospiceClaim) claim); + HospiceClaim hospiceClaim = (HospiceClaim) claim; + List securityTags = + securityTagManager.getClaimSecurityLevelDstu3( + String.valueOf(hospiceClaim.getClaimId()), HospiceTag.class); + eob = transformClaim(hospiceClaim, securityTags); } return eob; } @@ -74,10 +90,11 @@ public ExplanationOfBenefit transform(Object claim, boolean includeTaxNumber) { * Transforms a specified {@link HospiceClaim} into a FHIR {@link ExplanationOfBenefit}. * * @param claimGroup the CCW {@link HospiceClaim} to transform + * @param securityTags securityTags tag of a claim * @return a FHIR {@link ExplanationOfBenefit} resource that represents the specified {@link * HospiceClaim} */ - private ExplanationOfBenefit transformClaim(HospiceClaim claimGroup) { + private ExplanationOfBenefit transformClaim(HospiceClaim claimGroup, List securityTags) { ExplanationOfBenefit eob = new ExplanationOfBenefit(); // Common group level fields between all claim types @@ -197,6 +214,9 @@ private ExplanationOfBenefit transformClaim(HospiceClaim claimGroup) { eob, item, claimLine.getDeductibleCoinsuranceCd()); } TransformerUtils.setLastUpdated(eob, claimGroup.getLastUpdated()); + + eob.getMeta().setSecurity(securityTags); + return eob; } } diff --git a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/stu3/providers/InpatientClaimTransformer.java b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/stu3/providers/InpatientClaimTransformer.java index 9a64b9a99f..6f8dbfd190 100644 --- a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/stu3/providers/InpatientClaimTransformer.java +++ b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/stu3/providers/InpatientClaimTransformer.java @@ -9,12 +9,16 @@ import gov.cms.bfd.model.codebook.data.CcwCodebookVariable; import gov.cms.bfd.model.rif.entities.InpatientClaim; import gov.cms.bfd.model.rif.entities.InpatientClaimLine; +import gov.cms.bfd.model.rif.samhsa.InpatientTag; import gov.cms.bfd.server.war.commons.ClaimType; import gov.cms.bfd.server.war.commons.MedicareSegment; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException; import java.util.Collections; +import java.util.List; import java.util.Optional; import org.hl7.fhir.dstu3.model.Address; +import org.hl7.fhir.dstu3.model.Coding; import org.hl7.fhir.dstu3.model.ExplanationOfBenefit; import org.hl7.fhir.dstu3.model.ExplanationOfBenefit.ItemComponent; import org.springframework.stereotype.Component; @@ -34,6 +38,9 @@ final class InpatientClaimTransformer implements ClaimTransformerInterface { private static final String METRIC_NAME = MetricRegistry.name(InpatientClaimTransformer.class.getSimpleName(), "transform"); + /** The securityTagManager. */ + private final SecurityTagManager securityTagManager; + /** * Instantiates a new transformer. * @@ -43,10 +50,15 @@ final class InpatientClaimTransformer implements ClaimTransformerInterface { * * @param metricRegistry the metric registry * @param npiOrgLookup the npi org lookup + * @param securityTagManager SamhsaSecurityTag lookup */ - public InpatientClaimTransformer(MetricRegistry metricRegistry, NPIOrgLookup npiOrgLookup) { + public InpatientClaimTransformer( + MetricRegistry metricRegistry, + NPIOrgLookup npiOrgLookup, + SecurityTagManager securityTagManager) { this.metricRegistry = requireNonNull(metricRegistry); this.npiOrgLookup = requireNonNull(npiOrgLookup); + this.securityTagManager = requireNonNull(securityTagManager); } /** @@ -64,7 +76,11 @@ public ExplanationOfBenefit transform(Object claim, boolean includeTaxNumber) { } ExplanationOfBenefit eob; try (Timer.Context ignored = metricRegistry.timer(METRIC_NAME).time()) { - eob = transformClaim((InpatientClaim) claim); + InpatientClaim inpatientClaim = (InpatientClaim) claim; + List securityTags = + securityTagManager.getClaimSecurityLevelDstu3( + String.valueOf(inpatientClaim.getClaimId()), InpatientTag.class); + eob = transformClaim(inpatientClaim, securityTags); } return eob; } @@ -73,10 +89,12 @@ public ExplanationOfBenefit transform(Object claim, boolean includeTaxNumber) { * Transforms a specified {@link InpatientClaim} into a FHIR {@link ExplanationOfBenefit}. * * @param claimGroup the CCW {@link InpatientClaim} to transform + * @param securityTags securityTags tag of a claim * @return a FHIR {@link ExplanationOfBenefit} resource that represents the specified {@link * InpatientClaim} */ - private ExplanationOfBenefit transformClaim(InpatientClaim claimGroup) { + private ExplanationOfBenefit transformClaim( + InpatientClaim claimGroup, List securityTags) { ExplanationOfBenefit eob = new ExplanationOfBenefit(); // Common group level fields between all claim types @@ -277,6 +295,9 @@ private ExplanationOfBenefit transformClaim(InpatientClaim claimGroup) { eob, item, claimLine.getDeductibleCoinsuranceCd()); } TransformerUtils.setLastUpdated(eob, claimGroup.getLastUpdated()); + + eob.getMeta().setSecurity(securityTags); + return eob; } } diff --git a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/stu3/providers/OutpatientClaimTransformer.java b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/stu3/providers/OutpatientClaimTransformer.java index e1b87c354c..aa994e9597 100644 --- a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/stu3/providers/OutpatientClaimTransformer.java +++ b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/stu3/providers/OutpatientClaimTransformer.java @@ -10,13 +10,17 @@ import gov.cms.bfd.model.rif.entities.InpatientClaim; import gov.cms.bfd.model.rif.entities.OutpatientClaim; import gov.cms.bfd.model.rif.entities.OutpatientClaimLine; +import gov.cms.bfd.model.rif.samhsa.OutpatientTag; import gov.cms.bfd.server.war.commons.ClaimType; import gov.cms.bfd.server.war.commons.MedicareSegment; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException; import java.util.Arrays; +import java.util.List; import java.util.Map; import java.util.Optional; import org.hl7.fhir.dstu3.model.Address; +import org.hl7.fhir.dstu3.model.Coding; import org.hl7.fhir.dstu3.model.ExplanationOfBenefit; import org.hl7.fhir.dstu3.model.ExplanationOfBenefit.ItemComponent; import org.springframework.stereotype.Component; @@ -38,6 +42,9 @@ final class OutpatientClaimTransformer implements ClaimTransformerInterface { private static final String METRIC_NAME = MetricRegistry.name(OutpatientClaimTransformer.class.getSimpleName(), "transform"); + /** The securityTagManager. */ + private final SecurityTagManager securityTagManager; + /** * Instantiates a new transformer. * @@ -47,10 +54,15 @@ final class OutpatientClaimTransformer implements ClaimTransformerInterface { * * @param metricRegistry the metric registry * @param npiOrgLookup the npi org lookup + * @param securityTagManager SamhsaSecurityTag lookup */ - public OutpatientClaimTransformer(MetricRegistry metricRegistry, NPIOrgLookup npiOrgLookup) { + public OutpatientClaimTransformer( + MetricRegistry metricRegistry, + NPIOrgLookup npiOrgLookup, + SecurityTagManager securityTagManager) { this.metricRegistry = requireNonNull(metricRegistry); this.npiOrgLookup = requireNonNull(npiOrgLookup); + this.securityTagManager = requireNonNull(securityTagManager); } /** @@ -68,7 +80,11 @@ public ExplanationOfBenefit transform(Object claim, boolean includeTaxNumber) { } ExplanationOfBenefit eob; try (Timer.Context ignored = metricRegistry.timer(METRIC_NAME).time()) { - eob = transformClaim((OutpatientClaim) claim); + OutpatientClaim outpatientClaim = (OutpatientClaim) claim; + List securityTags = + securityTagManager.getClaimSecurityLevelDstu3( + String.valueOf(outpatientClaim.getClaimId()), OutpatientTag.class); + eob = transformClaim(outpatientClaim, securityTags); } return eob; } @@ -77,10 +93,12 @@ public ExplanationOfBenefit transform(Object claim, boolean includeTaxNumber) { * Transforms a specified {@link InpatientClaim} into a FHIR {@link ExplanationOfBenefit}. * * @param claimGroup the CCW {@link OutpatientClaim} to transform + * @param securityTags securityTags tag of a claim * @return a FHIR {@link ExplanationOfBenefit} resource that represents the specified {@link * OutpatientClaim} */ - private ExplanationOfBenefit transformClaim(OutpatientClaim claimGroup) { + private ExplanationOfBenefit transformClaim( + OutpatientClaim claimGroup, List securityTags) { ExplanationOfBenefit eob = new ExplanationOfBenefit(); // Common group level fields between all claim types @@ -316,6 +334,8 @@ private ExplanationOfBenefit transformClaim(OutpatientClaim claimGroup) { } } TransformerUtils.setLastUpdated(eob, claimGroup.getLastUpdated()); + + eob.getMeta().setSecurity(securityTags); return eob; } } diff --git a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/stu3/providers/SNFClaimTransformer.java b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/stu3/providers/SNFClaimTransformer.java index 58cd9e2011..bba46f3e04 100644 --- a/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/stu3/providers/SNFClaimTransformer.java +++ b/apps/bfd-server/bfd-server-war/src/main/java/gov/cms/bfd/server/war/stu3/providers/SNFClaimTransformer.java @@ -10,15 +10,19 @@ import gov.cms.bfd.model.codebook.data.CcwCodebookVariable; import gov.cms.bfd.model.rif.entities.SNFClaim; import gov.cms.bfd.model.rif.entities.SNFClaimLine; +import gov.cms.bfd.model.rif.samhsa.SnfTag; import gov.cms.bfd.server.war.commons.ClaimType; import gov.cms.bfd.server.war.commons.CommonTransformerUtils; import gov.cms.bfd.server.war.commons.MedicareSegment; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException; import java.math.BigDecimal; import java.util.Collections; +import java.util.List; import java.util.Map; import java.util.Optional; import org.hl7.fhir.dstu3.model.Address; +import org.hl7.fhir.dstu3.model.Coding; import org.hl7.fhir.dstu3.model.ExplanationOfBenefit; import org.hl7.fhir.dstu3.model.ExplanationOfBenefit.ItemComponent; import org.hl7.fhir.dstu3.model.ExplanationOfBenefit.SupportingInformationComponent; @@ -39,6 +43,9 @@ public class SNFClaimTransformer implements ClaimTransformerInterface { private static final String METRIC_NAME = MetricRegistry.name(SNFClaimTransformer.class.getSimpleName(), "transform"); + /** The securityTagManager. */ + private final SecurityTagManager securityTagManager; + /** * Instantiates a new transformer. * @@ -48,10 +55,15 @@ public class SNFClaimTransformer implements ClaimTransformerInterface { * * @param metricRegistry the metric registry * @param npiOrgLookup the npi org lookup + * @param securityTagManager SamhsaSecurityTag lookup */ - public SNFClaimTransformer(MetricRegistry metricRegistry, NPIOrgLookup npiOrgLookup) { + public SNFClaimTransformer( + MetricRegistry metricRegistry, + NPIOrgLookup npiOrgLookup, + SecurityTagManager securityTagManager) { this.metricRegistry = requireNonNull(metricRegistry); this.npiOrgLookup = requireNonNull(npiOrgLookup); + this.securityTagManager = requireNonNull(securityTagManager); } /** @@ -69,7 +81,11 @@ public ExplanationOfBenefit transform(Object claim, boolean includeTaxNumber) { } ExplanationOfBenefit eob; try (Timer.Context ignored = metricRegistry.timer(METRIC_NAME).time()) { - eob = transformClaim((SNFClaim) claim); + SNFClaim snfClaim = (SNFClaim) claim; + List securityTags = + securityTagManager.getClaimSecurityLevelDstu3( + String.valueOf(snfClaim.getClaimId()), SnfTag.class); + eob = transformClaim(snfClaim, securityTags); } return eob; } @@ -78,10 +94,11 @@ public ExplanationOfBenefit transform(Object claim, boolean includeTaxNumber) { * Transforms a specified {@link SNFClaim} into a FHIR {@link ExplanationOfBenefit}. * * @param claimGroup the CCW {@link SNFClaim} to transform + * @param securityTags securityTags tag of a claim * @return a FHIR {@link ExplanationOfBenefit} resource that represents the specified {@link * SNFClaim} */ - private ExplanationOfBenefit transformClaim(SNFClaim claimGroup) { + private ExplanationOfBenefit transformClaim(SNFClaim claimGroup, List securityTags) { ExplanationOfBenefit eob = new ExplanationOfBenefit(); // Common group level fields between all claim types @@ -239,6 +256,8 @@ private ExplanationOfBenefit transformClaim(SNFClaim claimGroup) { eob, item, claimLine.getDeductibleCoinsuranceCd()); } TransformerUtils.setLastUpdated(eob, claimGroup.getLastUpdated()); + + eob.getMeta().setSecurity(securityTags); return eob; } } diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/EndpointJsonComparatorBase.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/EndpointJsonComparatorBase.java index 79a998754a..6e511f9e01 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/EndpointJsonComparatorBase.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/EndpointJsonComparatorBase.java @@ -11,6 +11,7 @@ import gov.cms.bfd.model.rif.samples.StaticRifResourceGroup; import io.restassured.http.Header; import io.restassured.http.Headers; +import io.restassured.specification.RequestSpecification; import java.io.IOException; import java.io.UncheckedIOException; import java.nio.file.Path; @@ -78,16 +79,34 @@ protected static String getJsonResponseFor(String requestString) { requestString, new Headers(new Header("Content-Type", "application/json+fhir"))); } + /** + * Gets the json response for the specified endpoint request string and default content type json + * header. + * + * @param requestString the request string + * @param requestSpec the request Spec + * @return the json response for + */ + protected static String getJsonResponseFor( + String requestString, RequestSpecification requestSpec) { + return getJsonResponseFor( + requestString, + new Headers(new Header("Content-Type", "application/json+fhir")), + requestSpec); + } + /** * Gets the json response for the specified endpoint request string and specified headers. * * @param requestString the request string * @param headers the headers for the request + * @param requestSpec the request Specification * @return the json response for */ - protected static String getJsonResponseFor(String requestString, Headers headers) { + protected static String getJsonResponseFor( + String requestString, Headers headers, RequestSpecification requestSpec) { return given() - .spec(requestAuth) + .spec(requestSpec) .headers(headers) .expect() .log() @@ -101,6 +120,17 @@ protected static String getJsonResponseFor(String requestString, Headers headers .asString(); } + /** + * Gets the json response for the specified endpoint request string and specified headers. + * + * @param requestString the request string + * @param headers the headers for the request + * @return the json response for + */ + protected static String getJsonResponseFor(String requestString, Headers headers) { + return getJsonResponseFor(requestString, headers, requestAuth); + } + /** * Gets the expected json response directory. These are generated as a point in time comparison * when we know the responses are in a good state so that the json response tests can regression @@ -207,6 +237,16 @@ protected static Beneficiary getSampleABene() { return ServerTestUtils.get().getFirstBeneficiary(loadedRecords); } + /** + * Gets the first sample A beneficiary. + * + * @return the first sample A beneficiary + */ + protected static Beneficiary getSampleABeneSamhsa() { + List loadedRecords = ServerTestUtils.get().loadSampleASamhsaData(); + return ServerTestUtils.get().getFirstBeneficiary(loadedRecords); + } + /** * Gets the first sample A beneficiary. * diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/CarrierClaimTransformerV2Test.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/CarrierClaimTransformerV2Test.java index 9a7bb7475b..909dd25c5b 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/CarrierClaimTransformerV2Test.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/CarrierClaimTransformerV2Test.java @@ -5,6 +5,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -24,6 +25,7 @@ import gov.cms.bfd.server.war.commons.CCWUtils; import gov.cms.bfd.server.war.commons.ClaimType; import gov.cms.bfd.server.war.commons.MedicareSegment; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.TransformerConstants; import gov.cms.bfd.server.war.commons.carin.C4BBClaimProfessionalAndNonClinicianCareTeamRole; import gov.cms.bfd.server.war.commons.carin.C4BBPractitionerIdentifierType; @@ -127,10 +129,14 @@ public void before() throws IOException { when(metricsTimer.time()).thenReturn(metricsTimerContext); npiOrgLookup = RDATestUtils.mockNPIOrgLookup(); FdaDrugCodeDisplayLookup drugCodeDisplayLookup = RDATestUtils.fdaFakeDrugCodeDisplayLookup(); + SecurityTagManager securityTagManager = mock(SecurityTagManager.class); carrierClaimTransformer = new CarrierClaimTransformerV2( - metricRegistry, drugCodeDisplayLookup, NPIOrgLookup.createNpiOrgLookup()); + metricRegistry, + drugCodeDisplayLookup, + NPIOrgLookup.createNpiOrgLookup(), + securityTagManager); claim = generateClaim(); ExplanationOfBenefit genEob = carrierClaimTransformer.transform(claim, false); diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/DMEClaimTransformerV2Test.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/DMEClaimTransformerV2Test.java index 67b95bcaa1..b18560bbf5 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/DMEClaimTransformerV2Test.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/DMEClaimTransformerV2Test.java @@ -22,6 +22,7 @@ import gov.cms.bfd.server.war.ServerTestUtils; import gov.cms.bfd.server.war.commons.CCWUtils; import gov.cms.bfd.server.war.commons.ProfileConstants; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.TransformerConstants; import gov.cms.bfd.server.war.utils.RDATestUtils; import java.io.IOException; @@ -88,6 +89,9 @@ public final class DMEClaimTransformerV2Test { /** The NPI Org lookup. */ @Mock NPIOrgLookup mockNpiOrgLookup; + /** The SamhsaSecurityTag lookup. */ + @Mock SecurityTagManager securityTagManager; + /** * Generates the Claim object to be used in multiple tests. * @@ -121,7 +125,8 @@ public void before() throws IOException { when(mockNpiOrgLookup.retrieveNPIOrgDisplay(any())) .thenReturn(Optional.of("207X00000X\tOrthopaedic Surgery")); dmeClaimTransformer = - new DMEClaimTransformerV2(metricRegistry, fdaDrugCodeDisplayLookup, mockNpiOrgLookup); + new DMEClaimTransformerV2( + metricRegistry, fdaDrugCodeDisplayLookup, mockNpiOrgLookup, securityTagManager); claim = generateClaim(); ExplanationOfBenefit genEob = dmeClaimTransformer.transform(claim, false); IParser parser = fhirContext.newJsonParser(); diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/EndpointJsonResponseComparatorV2E2E.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/EndpointJsonResponseComparatorV2E2E.java index 96ec7b0860..bfbc32fb7d 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/EndpointJsonResponseComparatorV2E2E.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/EndpointJsonResponseComparatorV2E2E.java @@ -130,6 +130,9 @@ public static Stream data() { arguments( "eobReadInpatient", (Supplier) EndpointJsonResponseComparatorV2E2E::eobReadInpatient), + arguments( + "eobReadByPatientWithSamhsa", + (Supplier) EndpointJsonResponseComparatorV2E2E::eobReadByPatientWithSamhsa), arguments( "eobReadOutpatient", (Supplier) EndpointJsonResponseComparatorV2E2E::eobReadOutpatient), @@ -769,6 +772,27 @@ public static String eobReadInpatient() { return getJsonResponseFor(baseServerUrl + "/v2/fhir/ExplanationOfBenefit/" + eobId); } + /** + * Executes a search against the EOB endpoint using an inpatient claim id (based on the sample a + * data) and returns the sorted results. + * + * @return the sorted results + */ + public static String eobReadByPatientWithSamhsa() { + Beneficiary bene = getSampleABeneSamhsa(); + + String url = + baseServerUrl + + "/v2/fhir/ExplanationOfBenefit/?patient=" + + bene.getBeneficiaryId() + + "&_count=" + + 2 + + "&_page=" + + (6); + + return getJsonResponseFor(url + bene.getBeneficiaryId(), getRequestAuth(SAMHSA_KEYSTORE)); + } + /** * Executes a search against the EOB endpoint using an outpatient claim id (based on the sample a * data) and returns the sorted results. diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/HHAClaimTransformerV2Test.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/HHAClaimTransformerV2Test.java index 1f434962f6..41848e33ae 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/HHAClaimTransformerV2Test.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/HHAClaimTransformerV2Test.java @@ -21,6 +21,7 @@ import gov.cms.bfd.model.rif.samples.StaticRifResourceGroup; import gov.cms.bfd.server.war.ServerTestUtils; import gov.cms.bfd.server.war.commons.ProfileConstants; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.TransformerConstants; import gov.cms.bfd.server.war.utils.RDATestUtils; import java.io.IOException; @@ -86,6 +87,9 @@ public class HHAClaimTransformerV2Test { /** The metrics registry. */ @Mock MetricRegistry metricRegistry; + /** The SamhsaSecurityTag lookup. */ + @Mock SecurityTagManager securityTagManager; + /** The metrics timer. Used for determining the timer was started. */ @Mock Timer metricsTimer; @@ -127,7 +131,8 @@ public void before() throws IOException { npiOrgLookup = RDATestUtils.mockNPIOrgLookup(); hhaClaimTransformer = - new HHAClaimTransformerV2(metricRegistry, NPIOrgLookup.createNpiOrgLookup()); + new HHAClaimTransformerV2( + metricRegistry, NPIOrgLookup.createNpiOrgLookup(), securityTagManager); claim = generateClaim(); ExplanationOfBenefit genEob = hhaClaimTransformer.transform(claim, false); IParser parser = fhirContext.newJsonParser(); diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/HospiceClaimTransformerV2Test.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/HospiceClaimTransformerV2Test.java index 95f8dc3df2..81281a1bbf 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/HospiceClaimTransformerV2Test.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/HospiceClaimTransformerV2Test.java @@ -24,6 +24,7 @@ import gov.cms.bfd.server.war.commons.ClaimType; import gov.cms.bfd.server.war.commons.MedicareSegment; import gov.cms.bfd.server.war.commons.ProfileConstants; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.TransformerConstants; import gov.cms.bfd.server.war.utils.RDATestUtils; import java.io.IOException; @@ -86,6 +87,9 @@ public final class HospiceClaimTransformerV2Test { /** The metrics registry. */ @Mock MetricRegistry metricRegistry; + /** The SamhsaSecurityTag lookup. */ + @Mock SecurityTagManager securityTagManager; + /** The metrics timer. Used for determining the timer was started. */ @Mock Timer metricsTimer; @@ -107,7 +111,8 @@ public void generateClaim() throws FHIRException, IOException { npiOrgLookup = RDATestUtils.mockNPIOrgLookup(); hospiceClaimTransformer = - new HospiceClaimTransformerV2(metricRegistry, NPIOrgLookup.createNpiOrgLookup()); + new HospiceClaimTransformerV2( + metricRegistry, NPIOrgLookup.createNpiOrgLookup(), securityTagManager); List parsedRecords = ServerTestUtils.parseData(Arrays.asList(StaticRifResourceGroup.SAMPLE_A.getResources())); diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/InpatientClaimTransformerV2Test.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/InpatientClaimTransformerV2Test.java index 5e4084658a..2b87f1038d 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/InpatientClaimTransformerV2Test.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/InpatientClaimTransformerV2Test.java @@ -19,6 +19,7 @@ import gov.cms.bfd.model.rif.samples.StaticRifResourceGroup; import gov.cms.bfd.server.war.ServerTestUtils; import gov.cms.bfd.server.war.commons.ProfileConstants; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.TransformerConstants; import gov.cms.bfd.server.war.utils.RDATestUtils; import java.io.IOException; @@ -83,6 +84,9 @@ public final class InpatientClaimTransformerV2Test { /** The metrics registry. */ @Mock MetricRegistry metricRegistry; + /** The SamhsaSecurityTag lookup. */ + @Mock SecurityTagManager securityTagManager; + /** The metrics timer. Used for determining the timer was started. */ @Mock Timer metricsTimer; @@ -126,7 +130,8 @@ public void before() throws IOException { npiOrgLookup = RDATestUtils.mockNPIOrgLookup(); inpatientClaimTransformer = - new InpatientClaimTransformerV2(metricRegistry, NPIOrgLookup.createNpiOrgLookup()); + new InpatientClaimTransformerV2( + metricRegistry, NPIOrgLookup.createNpiOrgLookup(), securityTagManager); claim = generateClaim(); ExplanationOfBenefit genEob = inpatientClaimTransformer.transform(claim, false); IParser parser = fhirContext.newJsonParser(); diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/OutpatientClaimTransformerV2Test.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/OutpatientClaimTransformerV2Test.java index 982c34df03..e9da536433 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/OutpatientClaimTransformerV2Test.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/OutpatientClaimTransformerV2Test.java @@ -21,6 +21,7 @@ import gov.cms.bfd.model.rif.samples.StaticRifResourceGroup; import gov.cms.bfd.server.war.ServerTestUtils; import gov.cms.bfd.server.war.commons.ProfileConstants; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.TransformerConstants; import gov.cms.bfd.server.war.utils.RDATestUtils; import java.io.IOException; @@ -83,6 +84,9 @@ public final class OutpatientClaimTransformerV2Test { /** The metrics timer. Used for determining the timer was started. */ @Mock Timer metricsTimer; + /** The SamhsaSecurityTag lookup. */ + @Mock SecurityTagManager securityTagManager; + /** The metrics timer context. Used for determining the timer was stopped. */ @Mock Timer.Context metricsTimerContext; @@ -124,7 +128,10 @@ public void before() throws IOException { outpatientClaimTransformer = new OutpatientClaimTransformerV2( - metricRegistry, drugCodeDisplayLookup, NPIOrgLookup.createNpiOrgLookup()); + metricRegistry, + drugCodeDisplayLookup, + NPIOrgLookup.createNpiOrgLookup(), + securityTagManager); claim = generateClaim(); ExplanationOfBenefit genEob = outpatientClaimTransformer.transform(claim, false); IParser parser = fhirContext.newJsonParser(); diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/PatientClaimsEobTaskTransformerV2Test.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/PatientClaimsEobTaskTransformerV2Test.java index aac96fe8e3..076e3f87e3 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/PatientClaimsEobTaskTransformerV2Test.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/PatientClaimsEobTaskTransformerV2Test.java @@ -30,6 +30,7 @@ import gov.cms.bfd.model.rif.samples.StaticRifResourceGroup; import gov.cms.bfd.server.war.ServerTestUtils; import gov.cms.bfd.server.war.commons.ClaimType; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.TransformerConstants; import gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException; import jakarta.persistence.EntityManager; @@ -77,6 +78,9 @@ class PatientClaimsEobTaskTransformerV2Test { /** The NPI Org lookup. */ @Mock NPIOrgLookup mockNpiOrgLookup; + /** The SamhsaSecurityTag lookup. */ + @Mock SecurityTagManager securityTagManager; + /** The FDA drug display lookup. */ @Mock FdaDrugCodeDisplayLookup mockDrugDisplayLookup; @@ -209,7 +213,7 @@ void testTaskTransformerUsingCarrierClaimNoSamhsaFilter() { // Ignore metrics registry calls on the claim transformer; its not under test here ClaimTransformerInterfaceV2 claimTransformer = new CarrierClaimTransformerV2( - new MetricRegistry(), mockDrugDisplayLookup, mockNpiOrgLookup); + new MetricRegistry(), mockDrugDisplayLookup, mockNpiOrgLookup, securityTagManager); PatientClaimsEobTaskTransformerV2 taskTransformer = new PatientClaimsEobTaskTransformerV2( metricRegistry, mockSamhsaMatcher, mockDrugDisplayLookup, mockNpiOrgLookup); @@ -243,7 +247,7 @@ void testTaskTransformerUsingCarrierClaimWithSamhsa() { // Ignore metrics registry calls on the claim transformer; its not under test here ClaimTransformerInterfaceV2 claimTransformer = new CarrierClaimTransformerV2( - new MetricRegistry(), mockDrugDisplayLookup, mockNpiOrgLookup); + new MetricRegistry(), mockDrugDisplayLookup, mockNpiOrgLookup, securityTagManager); PatientClaimsEobTaskTransformerV2 taskTransformer = new PatientClaimsEobTaskTransformerV2( metricRegistry, mockSamhsaMatcher, mockDrugDisplayLookup, mockNpiOrgLookup); @@ -276,7 +280,8 @@ void testTaskTransformerUsingDmeClaimNoSamhsaFilter() { // Ignore metrics registry calls on the claim transformer; its not under test here ClaimTransformerInterfaceV2 claimTransformer = - new DMEClaimTransformerV2(new MetricRegistry(), mockDrugDisplayLookup, mockNpiOrgLookup); + new DMEClaimTransformerV2( + new MetricRegistry(), mockDrugDisplayLookup, mockNpiOrgLookup, securityTagManager); PatientClaimsEobTaskTransformerV2 taskTransformer = new PatientClaimsEobTaskTransformerV2( metricRegistry, mockSamhsaMatcher, mockDrugDisplayLookup, mockNpiOrgLookup); @@ -309,7 +314,8 @@ void testTaskTransformerUsingDmeClaimWithSamhsa() { // Ignore metrics registry calls on the claim transformer; its not under test here ClaimTransformerInterfaceV2 claimTransformer = - new DMEClaimTransformerV2(new MetricRegistry(), mockDrugDisplayLookup, mockNpiOrgLookup); + new DMEClaimTransformerV2( + new MetricRegistry(), mockDrugDisplayLookup, mockNpiOrgLookup, securityTagManager); PatientClaimsEobTaskTransformerV2 taskTransformer = new PatientClaimsEobTaskTransformerV2( metricRegistry, mockSamhsaMatcher, mockDrugDisplayLookup, mockNpiOrgLookup); @@ -342,7 +348,7 @@ void testTaskTransformerUsingHhaClaimWithSamhsa() { // Ignore metrics registry calls on the claim transformer; its not under test here ClaimTransformerInterfaceV2 claimTransformer = - new HHAClaimTransformerV2(new MetricRegistry(), mockNpiOrgLookup); + new HHAClaimTransformerV2(new MetricRegistry(), mockNpiOrgLookup, securityTagManager); PatientClaimsEobTaskTransformerV2 taskTransformer = new PatientClaimsEobTaskTransformerV2( metricRegistry, mockSamhsaMatcher, mockDrugDisplayLookup, mockNpiOrgLookup); @@ -376,7 +382,7 @@ void testTaskTransformerUsingHospiceClaimWithSamhsa() { // Ignore metrics registry calls on the claim transformer; its not under test here ClaimTransformerInterfaceV2 claimTransformer = - new HospiceClaimTransformerV2(new MetricRegistry(), mockNpiOrgLookup); + new HospiceClaimTransformerV2(new MetricRegistry(), mockNpiOrgLookup, securityTagManager); PatientClaimsEobTaskTransformerV2 taskTransformer = new PatientClaimsEobTaskTransformerV2( metricRegistry, mockSamhsaMatcher, mockDrugDisplayLookup, mockNpiOrgLookup); @@ -410,7 +416,7 @@ void testTaskTransformerUsingInpatientClaimWithSamhsa() { // Ignore metrics registry calls on the claim transformer; its not under test here ClaimTransformerInterfaceV2 claimTransformer = - new InpatientClaimTransformerV2(new MetricRegistry(), mockNpiOrgLookup); + new InpatientClaimTransformerV2(new MetricRegistry(), mockNpiOrgLookup, securityTagManager); PatientClaimsEobTaskTransformerV2 taskTransformer = new PatientClaimsEobTaskTransformerV2( metricRegistry, mockSamhsaMatcher, mockDrugDisplayLookup, mockNpiOrgLookup); @@ -445,7 +451,7 @@ void testTaskTransformerUsingOutpatientClaimWithSamhsa() { // Ignore metrics registry calls on the claim transformer; its not under test here ClaimTransformerInterfaceV2 claimTransformer = new OutpatientClaimTransformerV2( - new MetricRegistry(), mockDrugDisplayLookup, mockNpiOrgLookup); + new MetricRegistry(), mockDrugDisplayLookup, mockNpiOrgLookup, securityTagManager); PatientClaimsEobTaskTransformerV2 taskTransformer = new PatientClaimsEobTaskTransformerV2( metricRegistry, mockSamhsaMatcher, mockDrugDisplayLookup, mockNpiOrgLookup); @@ -513,7 +519,7 @@ void testTaskTransformerUsingSnfClaimWithSamhsa() { // Ignore metrics registry calls on the claim transformer; its not under test here ClaimTransformerInterfaceV2 claimTransformer = - new SNFClaimTransformerV2(new MetricRegistry(), mockNpiOrgLookup); + new SNFClaimTransformerV2(new MetricRegistry(), mockNpiOrgLookup, securityTagManager); PatientClaimsEobTaskTransformerV2 taskTransformer = new PatientClaimsEobTaskTransformerV2( metricRegistry, mockSamhsaMatcher, mockDrugDisplayLookup, mockNpiOrgLookup); @@ -549,7 +555,7 @@ void testGetFailureFromTaskTransformer() { setupClaimEntity(mockEntityManager, ClaimType.DME, clmMockCriteria, clmRoot); ClaimTransformerInterfaceV2 claimTransformer = - new SNFClaimTransformerV2(metricRegistry, mockNpiOrgLookup); + new SNFClaimTransformerV2(metricRegistry, mockNpiOrgLookup, securityTagManager); PatientClaimsEobTaskTransformerV2 taskTransformer = new PatientClaimsEobTaskTransformerV2( metricRegistry, mockSamhsaMatcher, mockDrugDisplayLookup, mockNpiOrgLookup); diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/SNFClaimTransformerV2Test.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/SNFClaimTransformerV2Test.java index 956e9792eb..0b9ca5628e 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/SNFClaimTransformerV2Test.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/SNFClaimTransformerV2Test.java @@ -20,6 +20,7 @@ import gov.cms.bfd.model.rif.samples.StaticRifResourceGroup; import gov.cms.bfd.server.war.ServerTestUtils; import gov.cms.bfd.server.war.commons.ProfileConstants; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.TransformerConstants; import gov.cms.bfd.server.war.utils.RDATestUtils; import java.io.IOException; @@ -83,6 +84,9 @@ public class SNFClaimTransformerV2Test { /** The metrics registry. */ @Mock MetricRegistry metricRegistry; + /** The SamhsaSecurityTag lookup. */ + @Mock SecurityTagManager securityTagManager; + /** The metrics timer. Used for determining the timer was started. */ @Mock Timer metricsTimer; @@ -126,7 +130,8 @@ public void before() throws IOException { npiOrgLookup = RDATestUtils.mockNPIOrgLookup(); snfClaimTransformer = - new SNFClaimTransformerV2(metricRegistry, NPIOrgLookup.createNpiOrgLookup()); + new SNFClaimTransformerV2( + metricRegistry, NPIOrgLookup.createNpiOrgLookup(), securityTagManager); claim = generateClaim(); ExplanationOfBenefit genEob = snfClaimTransformer.transform(claim, false); IParser parser = fhirContext.newJsonParser(); diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/SamhsaMatcherR4FromClaimTransformerV2Test.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/SamhsaMatcherR4FromClaimTransformerV2Test.java index 4985f5af95..de57df1a78 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/SamhsaMatcherR4FromClaimTransformerV2Test.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/SamhsaMatcherR4FromClaimTransformerV2Test.java @@ -2,6 +2,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.params.provider.Arguments.arguments; +import static org.mockito.Mockito.mock; import com.codahale.metrics.MetricRegistry; import gov.cms.bfd.data.fda.lookup.FdaDrugCodeDisplayLookup; @@ -21,6 +22,7 @@ import gov.cms.bfd.server.war.ServerTestUtils; import gov.cms.bfd.server.war.commons.CCWUtils; import gov.cms.bfd.server.war.commons.IcdCode; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.TransformerConstants; import gov.cms.bfd.server.war.utils.RDATestUtils; import java.io.IOException; @@ -130,20 +132,24 @@ public static Stream data() throws IOException { FdaDrugCodeDisplayLookup fdaDrugCodeDisplayLookup = new FdaDrugCodeDisplayLookup(npiDataStream); NPIOrgLookup npiOrgLookup = NPIOrgLookup.createNpiOrgLookup(); MetricRegistry metricRegistry = new MetricRegistry(); + SecurityTagManager securityTagManager = mock(SecurityTagManager.class); DMEClaimTransformerV2 dmeClaimTransformerV2 = - new DMEClaimTransformerV2(metricRegistry, fdaDrugCodeDisplayLookup, npiOrgLookup); + new DMEClaimTransformerV2( + metricRegistry, fdaDrugCodeDisplayLookup, npiOrgLookup, securityTagManager); CarrierClaimTransformerV2 carrierClaimTransformerV2 = - new CarrierClaimTransformerV2(metricRegistry, fdaDrugCodeDisplayLookup, npiOrgLookup); + new CarrierClaimTransformerV2( + metricRegistry, fdaDrugCodeDisplayLookup, npiOrgLookup, securityTagManager); HHAClaimTransformerV2 hhaClaimTransformerV2 = - new HHAClaimTransformerV2(metricRegistry, npiOrgLookup); + new HHAClaimTransformerV2(metricRegistry, npiOrgLookup, securityTagManager); InpatientClaimTransformerV2 inpatientClaimTransformerV2 = - new InpatientClaimTransformerV2(metricRegistry, npiOrgLookup); + new InpatientClaimTransformerV2(metricRegistry, npiOrgLookup, securityTagManager); OutpatientClaimTransformerV2 outpatientClaimTransformerV2 = - new OutpatientClaimTransformerV2(metricRegistry, fdaDrugCodeDisplayLookup, npiOrgLookup); + new OutpatientClaimTransformerV2( + metricRegistry, fdaDrugCodeDisplayLookup, npiOrgLookup, securityTagManager); PartDEventTransformerV2 partDEventTransformer = new PartDEventTransformerV2(metricRegistry, fdaDrugCodeDisplayLookup, npiOrgLookup); SNFClaimTransformerV2 snfClaimTransformerV2 = - new SNFClaimTransformerV2(metricRegistry, npiOrgLookup); + new SNFClaimTransformerV2(metricRegistry, npiOrgLookup, securityTagManager); ExplanationOfBenefit inpatientEob = inpatientClaimTransformerV2.transform(getClaim(InpatientClaim.class), false); @@ -160,7 +166,7 @@ public static Stream data() throws IOException { String hhaClaimType = TransformerUtilsV2.getClaimType(hhaEob).toString(); HospiceClaimTransformerV2 hospiceClaimTransformerV2 = - new HospiceClaimTransformerV2(new MetricRegistry(), npiOrgLookup); + new HospiceClaimTransformerV2(new MetricRegistry(), npiOrgLookup, securityTagManager); ExplanationOfBenefit hospiceEob = hospiceClaimTransformerV2.transform(getClaim(HospiceClaim.class), false); String hospiceClaimType = TransformerUtilsV2.getClaimType(hospiceEob).toString(); diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/TransformerTestUtilsV2.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/TransformerTestUtilsV2.java index fb11c62bea..64b947cb16 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/TransformerTestUtilsV2.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/TransformerTestUtilsV2.java @@ -29,6 +29,7 @@ import gov.cms.bfd.server.war.commons.ClaimType; import gov.cms.bfd.server.war.commons.CommonTransformerUtils; import gov.cms.bfd.server.war.commons.MedicareSegment; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.TransformerConstants; import gov.cms.bfd.server.war.commons.carin.C4BBClaimProfessionalAndNonClinicianCareTeamRole; import gov.cms.bfd.server.war.stu3.providers.ExplanationOfBenefitResourceProvider; @@ -1604,6 +1605,7 @@ static void assertExtensionCodingDoesNotExist( * @param includeTaxNumbers if tax numbers should be included in the response * @param drugCodeDisplayLookup the drug code display lookup * @param npiOrgLookup the npi org lookup + * @param securityTagManager SamhsaSecurityTags lookup * @return the transformed {@link ExplanationOfBenefit} for the specified RIF record */ static ExplanationOfBenefit transformRifRecordToEob( @@ -1611,29 +1613,37 @@ static ExplanationOfBenefit transformRifRecordToEob( MetricRegistry metricRegistry, boolean includeTaxNumbers, FdaDrugCodeDisplayLookup drugCodeDisplayLookup, - NPIOrgLookup npiOrgLookup) { + NPIOrgLookup npiOrgLookup, + SecurityTagManager securityTagManager) { ClaimTransformerInterfaceV2 claimTransformerInterface = null; if (rifRecord instanceof CarrierClaim) { claimTransformerInterface = - new CarrierClaimTransformerV2(metricRegistry, drugCodeDisplayLookup, npiOrgLookup); + new CarrierClaimTransformerV2( + metricRegistry, drugCodeDisplayLookup, npiOrgLookup, securityTagManager); } else if (rifRecord instanceof DMEClaim) { claimTransformerInterface = - new DMEClaimTransformerV2(metricRegistry, drugCodeDisplayLookup, npiOrgLookup); + new DMEClaimTransformerV2( + metricRegistry, drugCodeDisplayLookup, npiOrgLookup, securityTagManager); } else if (rifRecord instanceof HHAClaim) { - claimTransformerInterface = new HHAClaimTransformerV2(metricRegistry, npiOrgLookup); + claimTransformerInterface = + new HHAClaimTransformerV2(metricRegistry, npiOrgLookup, securityTagManager); } else if (rifRecord instanceof HospiceClaim) { - claimTransformerInterface = new HospiceClaimTransformerV2(metricRegistry, npiOrgLookup); + claimTransformerInterface = + new HospiceClaimTransformerV2(metricRegistry, npiOrgLookup, securityTagManager); } else if (rifRecord instanceof InpatientClaim) { - claimTransformerInterface = new InpatientClaimTransformerV2(metricRegistry, npiOrgLookup); + claimTransformerInterface = + new InpatientClaimTransformerV2(metricRegistry, npiOrgLookup, securityTagManager); } else if (rifRecord instanceof OutpatientClaim) { claimTransformerInterface = - new OutpatientClaimTransformerV2(metricRegistry, drugCodeDisplayLookup, npiOrgLookup); + new OutpatientClaimTransformerV2( + metricRegistry, drugCodeDisplayLookup, npiOrgLookup, securityTagManager); } else if (rifRecord instanceof PartDEvent) { claimTransformerInterface = new PartDEventTransformerV2(metricRegistry, drugCodeDisplayLookup, npiOrgLookup); } else if (rifRecord instanceof SNFClaim) { - claimTransformerInterface = new SNFClaimTransformerV2(metricRegistry, npiOrgLookup); + claimTransformerInterface = + new SNFClaimTransformerV2(metricRegistry, npiOrgLookup, securityTagManager); } else { throw new BadCodeMonkeyException("Unhandled RifRecord type!"); } diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/TransformerUtilsV2Test.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/TransformerUtilsV2Test.java index 572b5ca3e0..56020a757b 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/TransformerUtilsV2Test.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/TransformerUtilsV2Test.java @@ -33,6 +33,7 @@ import gov.cms.bfd.server.war.commons.Profile; import gov.cms.bfd.server.war.commons.ProfileConstants; import gov.cms.bfd.server.war.commons.QueryUtils; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.TransformerConstants; import gov.cms.bfd.server.war.commons.carin.C4BBAdjudication; import gov.cms.bfd.server.war.commons.carin.C4BBAdjudicationStatus; @@ -71,6 +72,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; import org.mockito.MockedStatic; import org.mockito.junit.jupiter.MockitoExtension; import org.mockito.junit.jupiter.MockitoSettings; @@ -83,6 +85,9 @@ public class TransformerUtilsV2Test { /** The NPI org lookup to use for the test. */ private MockedStatic npiOrgLookup; + /** The SamhsaSecurityTag lookup. */ + @Mock SecurityTagManager securityTagManager; + /** One-time setup of objects that are normally injected. */ @BeforeEach protected void setup() { @@ -918,7 +923,7 @@ public void createBundleWithoutPagingWithASizeOf2() throws IOException { FhirContext fhirContext = FhirContext.forR4(); ClaimTransformerInterfaceV2 claimTransformerInterface = - new HHAClaimTransformerV2(new MetricRegistry(), npiOrgLookup); + new HHAClaimTransformerV2(new MetricRegistry(), npiOrgLookup, securityTagManager); ExplanationOfBenefit genEob = claimTransformerInterface.transform(hhaClaim, false); IParser parser = fhirContext.newJsonParser(); String json = parser.encodeResourceToString(genEob); @@ -933,7 +938,8 @@ public void createBundleWithoutPagingWithASizeOf2() throws IOException { .get(); hospiceClaim.setLastUpdated(Instant.now()); - claimTransformerInterface = new HospiceClaimTransformerV2(new MetricRegistry(), npiOrgLookup); + claimTransformerInterface = + new HospiceClaimTransformerV2(new MetricRegistry(), npiOrgLookup, securityTagManager); genEob = claimTransformerInterface.transform(hospiceClaim, false); parser = fhirContext.newJsonParser(); json = parser.encodeResourceToString(genEob); @@ -952,7 +958,10 @@ public void createBundleWithoutPagingWithASizeOf2() throws IOException { .getResourceAsStream(App.FDA_PRODUCTS_RESOURCE); claimTransformerInterface = new DMEClaimTransformerV2( - new MetricRegistry(), new FdaDrugCodeDisplayLookup(npiDataStream), npiOrgLookup); + new MetricRegistry(), + new FdaDrugCodeDisplayLookup(npiDataStream), + npiOrgLookup, + securityTagManager); genEob = claimTransformerInterface.transform(dmeClaim, false); parser = fhirContext.newJsonParser(); json = parser.encodeResourceToString(genEob); @@ -966,7 +975,8 @@ public void createBundleWithoutPagingWithASizeOf2() throws IOException { .get(); inpatientClaim.setLastUpdated(Instant.now()); - claimTransformerInterface = new InpatientClaimTransformerV2(new MetricRegistry(), npiOrgLookup); + claimTransformerInterface = + new InpatientClaimTransformerV2(new MetricRegistry(), npiOrgLookup, securityTagManager); genEob = claimTransformerInterface.transform(inpatientClaim, false); parser = fhirContext.newJsonParser(); json = parser.encodeResourceToString(genEob); @@ -1093,7 +1103,8 @@ public void createBundleWithoutPaging() throws IOException { FhirContext fhirContext = FhirContext.forR4(); ClaimTransformerInterfaceV2 claimTransformerInterface = - new HHAClaimTransformerV2(new MetricRegistry(), NPIOrgLookup.createNpiOrgLookup()); + new HHAClaimTransformerV2( + new MetricRegistry(), NPIOrgLookup.createNpiOrgLookup(), securityTagManager); ExplanationOfBenefit genEob = claimTransformerInterface.transform(hhaClaim, false); IParser parser = fhirContext.newJsonParser(); String json = parser.encodeResourceToString(genEob); diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/pac/FissClaimTransformerV2Test.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/pac/FissClaimTransformerV2Test.java index c61c0670b2..6cdbc11ce2 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/pac/FissClaimTransformerV2Test.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/pac/FissClaimTransformerV2Test.java @@ -3,11 +3,13 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.params.provider.Arguments.arguments; +import static org.mockito.Mockito.mock; import com.codahale.metrics.MetricRegistry; import gov.cms.bfd.model.rda.entities.RdaFissClaim; import gov.cms.bfd.model.rda.entities.RdaFissDiagnosisCode; import gov.cms.bfd.model.rda.entities.RdaFissRevenueLine; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import java.time.Instant; import java.time.LocalDate; import java.util.ArrayList; @@ -130,6 +132,7 @@ public void diagnosisCodeTest( int numberOfRecords) { RdaFissClaim entity = new RdaFissClaim(); + SecurityTagManager securityTagManager = mock(SecurityTagManager.class); entity.setLastUpdated(Instant.ofEpochMilli(1)); entity.setStmtCovToDate(LocalDate.of(2020, 1, 1)); @@ -155,7 +158,7 @@ public void diagnosisCodeTest( entity.setRevenueLines(Set.of(line)); FissClaimTransformerV2 fissClaimTransformerV2 = - new FissClaimTransformerV2(new MetricRegistry()); + new FissClaimTransformerV2(new MetricRegistry(), securityTagManager); Claim claim = fissClaimTransformerV2.transform(entity, true); diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/pac/McsClaimTransformerV2Test.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/pac/McsClaimTransformerV2Test.java index bd9595c4ff..b346e9d910 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/pac/McsClaimTransformerV2Test.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/pac/McsClaimTransformerV2Test.java @@ -2,11 +2,13 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.params.provider.Arguments.arguments; +import static org.mockito.Mockito.mock; import com.codahale.metrics.MetricRegistry; import gov.cms.bfd.model.rda.entities.RdaMcsClaim; import gov.cms.bfd.model.rda.entities.RdaMcsDetail; import gov.cms.bfd.model.rda.entities.RdaMcsDiagnosisCode; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import java.time.Instant; import java.time.LocalDate; import java.util.ArrayList; @@ -100,6 +102,7 @@ public void diagnosisCodeTest( int numberOfRecords) { RdaMcsClaim entity = new RdaMcsClaim(); + SecurityTagManager securityTagManager = mock(SecurityTagManager.class); entity.setLastUpdated(Instant.ofEpochMilli(1)); @@ -141,7 +144,8 @@ public void diagnosisCodeTest( entity.setDiagCodes(diagnoses); entity.setDetails(new HashSet<>(procedures)); - McsClaimTransformerV2 mcsClaimTransformerV2 = new McsClaimTransformerV2(new MetricRegistry()); + McsClaimTransformerV2 mcsClaimTransformerV2 = + new McsClaimTransformerV2(new MetricRegistry(), securityTagManager); Claim claim = mcsClaimTransformerV2.transform(entity, true); assertEquals(numberOfRecords, claim.getDiagnosis().size()); diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/pac/R4ClaimSamhsaMatcherTransformerTest.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/pac/R4ClaimSamhsaMatcherTransformerTest.java index 93c931dcd5..9b3f3e941b 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/pac/R4ClaimSamhsaMatcherTransformerTest.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/r4/providers/pac/R4ClaimSamhsaMatcherTransformerTest.java @@ -2,6 +2,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.params.provider.Arguments.arguments; +import static org.mockito.Mockito.mock; import com.codahale.metrics.MetricRegistry; import gov.cms.bfd.model.rda.entities.RdaFissClaim; @@ -11,6 +12,7 @@ import gov.cms.bfd.model.rda.entities.RdaMcsClaim; import gov.cms.bfd.model.rda.entities.RdaMcsDetail; import gov.cms.bfd.model.rda.entities.RdaMcsDiagnosisCode; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import java.time.Instant; import java.time.LocalDate; import java.util.List; @@ -359,6 +361,7 @@ public void fissTest( boolean expectedResult, String errorMessagePostFix) { RdaFissClaim entity = new RdaFissClaim(); + SecurityTagManager securityTagManager = mock(SecurityTagManager.class); entity.setLastUpdated(Instant.ofEpochMilli(1)); entity.setStmtCovToDate(toDate); @@ -398,8 +401,9 @@ public void fissTest( entity.setProcCodes(procedures); entity.setRevenueLines(Set.of(line)); FissClaimTransformerV2 fissClaimTransformerV2 = - new FissClaimTransformerV2(new MetricRegistry()); - McsClaimTransformerV2 mcsClaimTransformerV2 = new McsClaimTransformerV2(new MetricRegistry()); + new FissClaimTransformerV2(new MetricRegistry(), securityTagManager); + McsClaimTransformerV2 mcsClaimTransformerV2 = + new McsClaimTransformerV2(new MetricRegistry(), securityTagManager); Claim claim = fissClaimTransformerV2.transform(entity, true); @@ -495,6 +499,7 @@ public void mcsTest( boolean expectedResult, String errorMessagePostFix) { RdaMcsClaim entity = new RdaMcsClaim(); + SecurityTagManager securityTagManager = mock(SecurityTagManager.class); entity.setLastUpdated(Instant.ofEpochMilli(1)); @@ -535,8 +540,9 @@ public void mcsTest( entity.setDetails(procedures); FissClaimTransformerV2 fissClaimTransformerV2 = - new FissClaimTransformerV2(new MetricRegistry()); - McsClaimTransformerV2 mcsClaimTransformerV2 = new McsClaimTransformerV2(new MetricRegistry()); + new FissClaimTransformerV2(new MetricRegistry(), securityTagManager); + McsClaimTransformerV2 mcsClaimTransformerV2 = + new McsClaimTransformerV2(new MetricRegistry(), securityTagManager); Claim claim = mcsClaimTransformerV2.transform(entity, true); diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/CarrierClaimTransformerTest.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/CarrierClaimTransformerTest.java index 55f76a61f8..f20c437afc 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/CarrierClaimTransformerTest.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/CarrierClaimTransformerTest.java @@ -24,6 +24,7 @@ import gov.cms.bfd.server.war.commons.CCWUtils; import gov.cms.bfd.server.war.commons.ClaimType; import gov.cms.bfd.server.war.commons.MedicareSegment; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.TransformerConstants; import gov.cms.bfd.server.war.utils.RDATestUtils; import java.io.IOException; @@ -61,6 +62,9 @@ public final class CarrierClaimTransformerTest { /** The NPI org lookup to use for the test. */ @Mock NPIOrgLookup npiOrgLookup; + /** The securityTagManager. */ + @Mock SecurityTagManager securityTagManager; + /** The mock metric timer. */ @Mock Timer metricsTimer; @@ -78,7 +82,8 @@ protected void setup() { .thenReturn("UNKNOWN"); carrierClaimTransformer = - new CarrierClaimTransformer(metricRegistry, drugDisplayLookup, npiOrgLookup); + new CarrierClaimTransformer( + metricRegistry, drugDisplayLookup, npiOrgLookup, securityTagManager); } /** diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/DMEClaimTransformerTest.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/DMEClaimTransformerTest.java index 60df29d056..ddc17ea37c 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/DMEClaimTransformerTest.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/DMEClaimTransformerTest.java @@ -23,6 +23,7 @@ import gov.cms.bfd.server.war.commons.CCWUtils; import gov.cms.bfd.server.war.commons.ClaimType; import gov.cms.bfd.server.war.commons.MedicareSegment; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.TransformerConstants; import java.io.IOException; import java.time.Instant; @@ -55,6 +56,9 @@ public final class DMEClaimTransformerTest { /** The FDA drug lookup to use for the test. */ @Mock FdaDrugCodeDisplayLookup drugDisplayLookup; + /** The securityTagManager. */ + @Mock SecurityTagManager securityTagManager; + /** The metrics timer. Used for determining the timer was started. */ @Mock Timer metricsTimer; @@ -70,7 +74,8 @@ protected void setup() { when(drugDisplayLookup.retrieveFDADrugCodeDisplay(Optional.of(anyString()))) .thenReturn("UNKNOWN"); - dmeClaimTransformer = new DMEClaimTransformer(metricRegistry, drugDisplayLookup); + dmeClaimTransformer = + new DMEClaimTransformer(metricRegistry, drugDisplayLookup, securityTagManager); } /** diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/EndpointJsonResponseComparatorE2E.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/EndpointJsonResponseComparatorE2E.java index db692bda5c..59c3512bc7 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/EndpointJsonResponseComparatorE2E.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/EndpointJsonResponseComparatorE2E.java @@ -104,6 +104,9 @@ public static Stream data() { arguments( "eobByPatientIdAll", (Supplier) EndpointJsonResponseComparatorE2E::eobByPatientIdAll), + arguments( + "eobByPatientIdAllWithSamhsa", + (Supplier) EndpointJsonResponseComparatorE2E::eobByPatientIdAllWithSamhsa), arguments( "eobByPatientIdPaged", (Supplier) EndpointJsonResponseComparatorE2E::eobByPatientIdPaged), @@ -575,6 +578,26 @@ public static String eobByPatientIdAll() { return sortDiagnosisTypes(response, "/entry/3/resource/diagnosis/7/type"); } + /** + * Executes a search against the EOB endpoint using the sample A bene id and returns the sorted + * results. + * + * @return the sorted results + */ + public static String eobByPatientIdAllWithSamhsa() { + Beneficiary beneficiary = getSampleABeneSamhsa(); + + String url = + baseServerUrl + + "/v1/fhir/ExplanationOfBenefit/?patient=" + + beneficiary.getBeneficiaryId() + + "&_count=" + + 2 + + "&_page=" + + (6); + return getJsonResponseFor(url, getRequestAuth(SAMHSA_KEYSTORE)); + } + /** * Executes a search against the EOB endpoint using the sample A bene id and returns the sorted * results with paging. diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/HHAClaimTransformerTest.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/HHAClaimTransformerTest.java index 7f61ffcef4..fec378631e 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/HHAClaimTransformerTest.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/HHAClaimTransformerTest.java @@ -17,6 +17,7 @@ import gov.cms.bfd.server.war.ServerTestUtils; import gov.cms.bfd.server.war.commons.ClaimType; import gov.cms.bfd.server.war.commons.MedicareSegment; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.utils.RDATestUtils; import java.io.IOException; import java.util.Arrays; @@ -46,6 +47,9 @@ public final class HHAClaimTransformerTest { /** The Metric Registry to use for the test. */ @Mock MetricRegistry metricRegistry; + /** The securityTagManager. */ + @Mock SecurityTagManager securityTagManager; + /** The metrics timer. Used for determining the timer was started. */ @Mock Timer metricsTimer; @@ -63,7 +67,8 @@ public void setup() throws IOException { npiOrgLookup = RDATestUtils.mockNPIOrgLookup(); hhaClaimTransformer = - new HHAClaimTransformer(metricRegistry, NPIOrgLookup.createNpiOrgLookup()); + new HHAClaimTransformer( + metricRegistry, NPIOrgLookup.createNpiOrgLookup(), securityTagManager); } /** Releases the static mock NPIOrgLookup. */ diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/HospiceClaimTransformerTest.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/HospiceClaimTransformerTest.java index d0cd9289ad..0067b754fa 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/HospiceClaimTransformerTest.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/HospiceClaimTransformerTest.java @@ -17,6 +17,7 @@ import gov.cms.bfd.server.war.ServerTestUtils; import gov.cms.bfd.server.war.commons.ClaimType; import gov.cms.bfd.server.war.commons.MedicareSegment; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.utils.RDATestUtils; import java.io.IOException; import java.util.Arrays; @@ -52,6 +53,9 @@ public final class HospiceClaimTransformerTest { /** The metrics timer context. Used for determining the timer was stopped. */ @Mock Timer.Context metricsTimerContext; + /** The securityTagManager. */ + @Mock SecurityTagManager securityTagManager; + /** The NPI org lookup to use for the test. */ private MockedStatic npiOrgLookup; @@ -63,7 +67,8 @@ public void setup() throws IOException { npiOrgLookup = RDATestUtils.mockNPIOrgLookup(); hospiceClaimTransformer = - new HospiceClaimTransformer(metricRegistry, NPIOrgLookup.createNpiOrgLookup()); + new HospiceClaimTransformer( + metricRegistry, NPIOrgLookup.createNpiOrgLookup(), securityTagManager); } /** Releases the static mock NPIOrgLookup. */ diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/InpatientClaimTransformerTest.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/InpatientClaimTransformerTest.java index cc7207bb9a..bffc6b8431 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/InpatientClaimTransformerTest.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/InpatientClaimTransformerTest.java @@ -20,6 +20,7 @@ import gov.cms.bfd.server.war.commons.CommonTransformerUtils; import gov.cms.bfd.server.war.commons.Diagnosis; import gov.cms.bfd.server.war.commons.MedicareSegment; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.utils.RDATestUtils; import java.io.IOException; import java.time.Instant; @@ -49,6 +50,9 @@ public final class InpatientClaimTransformerTest { /** The Metric Registry to use for the test. */ @Mock MetricRegistry metricRegistry; + /** The securityTagManager. */ + @Mock SecurityTagManager securityTagManager; + /** The metrics timer. Used for determining the timer was started. */ @Mock Timer metricsTimer; @@ -66,7 +70,8 @@ public void setup() throws IOException { npiOrgLookup = RDATestUtils.mockNPIOrgLookup(); inpatientClaimTransformer = - new InpatientClaimTransformer(metricRegistry, NPIOrgLookup.createNpiOrgLookup()); + new InpatientClaimTransformer( + metricRegistry, NPIOrgLookup.createNpiOrgLookup(), securityTagManager); } /** Releases the static mock NPIOrgLookup. */ diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/OutpatientClaimTransformerTest.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/OutpatientClaimTransformerTest.java index a4d50820f3..9a80adefcb 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/OutpatientClaimTransformerTest.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/OutpatientClaimTransformerTest.java @@ -19,6 +19,7 @@ import gov.cms.bfd.server.war.commons.CCWProcedure; import gov.cms.bfd.server.war.commons.ClaimType; import gov.cms.bfd.server.war.commons.MedicareSegment; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.utils.RDATestUtils; import java.io.IOException; import java.time.ZoneId; @@ -51,6 +52,9 @@ public final class OutpatientClaimTransformerTest { /** The Metric Registry to use for the test. */ @Mock MetricRegistry metricRegistry; + /** The SamhsaSecurityTag lookup. */ + @Mock SecurityTagManager securityTagManager; + /** The metrics timer. Used for determining the timer was started. */ @Mock Timer metricsTimer; @@ -68,7 +72,8 @@ public void setup() throws IOException { npiOrgLookup = RDATestUtils.mockNPIOrgLookup(); outpatientClaimTransformer = - new OutpatientClaimTransformer(metricRegistry, NPIOrgLookup.createNpiOrgLookup()); + new OutpatientClaimTransformer( + metricRegistry, NPIOrgLookup.createNpiOrgLookup(), securityTagManager); } /** Releases the static mock NPIOrgLookup. */ diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/PatientClaimsEobTaskTransformerTest.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/PatientClaimsEobTaskTransformerTest.java index cc23060d37..668a155d1d 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/PatientClaimsEobTaskTransformerTest.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/PatientClaimsEobTaskTransformerTest.java @@ -30,6 +30,7 @@ import gov.cms.bfd.model.rif.samples.StaticRifResourceGroup; import gov.cms.bfd.server.war.ServerTestUtils; import gov.cms.bfd.server.war.commons.ClaimType; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.TransformerConstants; import gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException; import jakarta.persistence.EntityManager; @@ -77,6 +78,9 @@ class PatientClaimsEobTaskTransformerTest { /** The NPI Org lookup. */ @Mock NPIOrgLookup mockNpiOrgLookup; + /** The securityTagManager. */ + @Mock SecurityTagManager securityTagManager; + /** The FDA drug display lookup. */ @Mock FdaDrugCodeDisplayLookup mockDrugDisplayLookup; @@ -204,7 +208,8 @@ void testTaskTransformerUsingCarrierClaimNoSamhsaFilter() { // Ignore metrics registry calls on the claim transformer; its not under test here ClaimTransformerInterface claimTransformer = - new CarrierClaimTransformer(new MetricRegistry(), mockDrugDisplayLookup, mockNpiOrgLookup); + new CarrierClaimTransformer( + new MetricRegistry(), mockDrugDisplayLookup, mockNpiOrgLookup, securityTagManager); PatientClaimsEobTaskTransformer taskTransformer = new PatientClaimsEobTaskTransformer( metricRegistry, mockSamhsaMatcher, mockDrugDisplayLookup, mockNpiOrgLookup); @@ -237,7 +242,8 @@ void testTaskTransformerUsingCarrierClaimWithSamhsa() { // Ignore metrics registry calls on the claim transformer; its not under test here ClaimTransformerInterface claimTransformer = - new CarrierClaimTransformer(new MetricRegistry(), mockDrugDisplayLookup, mockNpiOrgLookup); + new CarrierClaimTransformer( + new MetricRegistry(), mockDrugDisplayLookup, mockNpiOrgLookup, securityTagManager); PatientClaimsEobTaskTransformer taskTransformer = new PatientClaimsEobTaskTransformer( metricRegistry, mockSamhsaMatcher, mockDrugDisplayLookup, mockNpiOrgLookup); @@ -270,7 +276,7 @@ void testTaskTransformerUsingDmeClaimNoSamhsaFilter() { // Ignore metrics registry calls on the claim transformer; its not under test here ClaimTransformerInterface claimTransformer = - new DMEClaimTransformer(new MetricRegistry(), mockDrugDisplayLookup); + new DMEClaimTransformer(new MetricRegistry(), mockDrugDisplayLookup, securityTagManager); PatientClaimsEobTaskTransformer taskTransformer = new PatientClaimsEobTaskTransformer( metricRegistry, mockSamhsaMatcher, mockDrugDisplayLookup, mockNpiOrgLookup); @@ -303,7 +309,7 @@ void testTaskTransformerUsingDmeClaimWithSamhsa() { // Ignore metrics registry calls on the claim transformer; its not under test here ClaimTransformerInterface claimTransformer = - new DMEClaimTransformer(new MetricRegistry(), mockDrugDisplayLookup); + new DMEClaimTransformer(new MetricRegistry(), mockDrugDisplayLookup, securityTagManager); PatientClaimsEobTaskTransformer taskTransformer = new PatientClaimsEobTaskTransformer( metricRegistry, mockSamhsaMatcher, mockDrugDisplayLookup, mockNpiOrgLookup); @@ -336,7 +342,7 @@ void testTaskTransformerUsingHhaClaimWithSamhsa() { // Ignore metrics registry calls on the claim transformer; its not under test here ClaimTransformerInterface claimTransformer = - new HHAClaimTransformer(new MetricRegistry(), mockNpiOrgLookup); + new HHAClaimTransformer(new MetricRegistry(), mockNpiOrgLookup, securityTagManager); PatientClaimsEobTaskTransformer taskTransformer = new PatientClaimsEobTaskTransformer( metricRegistry, mockSamhsaMatcher, mockDrugDisplayLookup, mockNpiOrgLookup); @@ -370,7 +376,7 @@ void testTaskTransformerUsingHospiceClaimWithSamhsa() { // Ignore metrics registry calls on the claim transformer; its not under test here ClaimTransformerInterface claimTransformer = - new HospiceClaimTransformer(new MetricRegistry(), mockNpiOrgLookup); + new HospiceClaimTransformer(new MetricRegistry(), mockNpiOrgLookup, securityTagManager); PatientClaimsEobTaskTransformer taskTransformer = new PatientClaimsEobTaskTransformer( metricRegistry, mockSamhsaMatcher, mockDrugDisplayLookup, mockNpiOrgLookup); @@ -404,7 +410,7 @@ void testTaskTransformerUsingInpatientClaimWithSamhsa() { // Ignore metrics registry calls on the claim transformer; its not under test here ClaimTransformerInterface claimTransformer = - new InpatientClaimTransformer(new MetricRegistry(), mockNpiOrgLookup); + new InpatientClaimTransformer(new MetricRegistry(), mockNpiOrgLookup, securityTagManager); PatientClaimsEobTaskTransformer taskTransformer = new PatientClaimsEobTaskTransformer( metricRegistry, mockSamhsaMatcher, mockDrugDisplayLookup, mockNpiOrgLookup); @@ -438,7 +444,7 @@ void testTaskTransformerUsingOutpatientClaimWithSamhsa() { // Ignore metrics registry calls on the claim transformer; its not under test here ClaimTransformerInterface claimTransformer = - new OutpatientClaimTransformer(new MetricRegistry(), mockNpiOrgLookup); + new OutpatientClaimTransformer(new MetricRegistry(), mockNpiOrgLookup, securityTagManager); PatientClaimsEobTaskTransformer taskTransformer = new PatientClaimsEobTaskTransformer( metricRegistry, mockSamhsaMatcher, mockDrugDisplayLookup, mockNpiOrgLookup); @@ -506,7 +512,7 @@ void testTaskTransformerUsingSnfClaimWithSamhsa() { // Ignore metrics registry calls on the claim transformer; its not under test here ClaimTransformerInterface claimTransformer = - new SNFClaimTransformer(new MetricRegistry(), mockNpiOrgLookup); + new SNFClaimTransformer(new MetricRegistry(), mockNpiOrgLookup, securityTagManager); PatientClaimsEobTaskTransformer taskTransformer = new PatientClaimsEobTaskTransformer( metricRegistry, mockSamhsaMatcher, mockDrugDisplayLookup, mockNpiOrgLookup); @@ -542,7 +548,7 @@ void testGetFailureFromTaskTransformer() { setupClaimEntity(mockEntityManager, ClaimType.DME, clmMockCriteria, clmRoot); ClaimTransformerInterface claimTransformer = - new SNFClaimTransformer(metricRegistry, mockNpiOrgLookup); + new SNFClaimTransformer(metricRegistry, mockNpiOrgLookup, securityTagManager); PatientClaimsEobTaskTransformer taskTransformer = new PatientClaimsEobTaskTransformer( metricRegistry, mockSamhsaMatcher, mockDrugDisplayLookup, mockNpiOrgLookup); diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/SNFClaimTransformerTest.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/SNFClaimTransformerTest.java index 4624855c77..c921b65703 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/SNFClaimTransformerTest.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/SNFClaimTransformerTest.java @@ -19,6 +19,7 @@ import gov.cms.bfd.server.war.commons.ClaimType; import gov.cms.bfd.server.war.commons.CommonTransformerUtils; import gov.cms.bfd.server.war.commons.MedicareSegment; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.utils.RDATestUtils; import java.io.IOException; import java.math.BigDecimal; @@ -50,6 +51,9 @@ public final class SNFClaimTransformerTest { /** The Metric Registry to use for the test. */ @Mock MetricRegistry metricRegistry; + /** The securityTagManager. */ + @Mock SecurityTagManager securityTagManager; + /** The metrics timer. Used for determining the timer was started. */ @Mock Timer metricsTimer; @@ -67,7 +71,8 @@ public void setup() throws IOException { npiOrgLookup = RDATestUtils.mockNPIOrgLookup(); snfClaimTransformer = - new SNFClaimTransformer(metricRegistry, NPIOrgLookup.createNpiOrgLookup()); + new SNFClaimTransformer( + metricRegistry, NPIOrgLookup.createNpiOrgLookup(), securityTagManager); } /** Releases the static mock NPIOrgLookup. */ diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/SamhsaMatcherFromClaimTransformerTest.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/SamhsaMatcherFromClaimTransformerTest.java index 8f1be8b718..fda40f910d 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/SamhsaMatcherFromClaimTransformerTest.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/SamhsaMatcherFromClaimTransformerTest.java @@ -2,6 +2,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.params.provider.Arguments.arguments; +import static org.mockito.Mockito.mock; import com.codahale.metrics.MetricRegistry; import gov.cms.bfd.data.fda.lookup.FdaDrugCodeDisplayLookup; @@ -21,6 +22,7 @@ import gov.cms.bfd.server.war.ServerTestUtils; import gov.cms.bfd.server.war.commons.CCWUtils; import gov.cms.bfd.server.war.commons.IcdCode; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.TransformerConstants; import gov.cms.bfd.server.war.utils.RDATestUtils; import java.io.IOException; @@ -116,6 +118,7 @@ public void after() { */ public static Stream data() throws IOException { NPIOrgLookup localNpiLookup = NPIOrgLookup.createNpiOrgLookup(); + SecurityTagManager securityTagManager = mock(SecurityTagManager.class); InputStream npiDataStream = Thread.currentThread() @@ -125,40 +128,44 @@ public static Stream data() throws IOException { // Load and transform the various claim types for testing ClaimTransformerInterface claimTransformerInterface = - new InpatientClaimTransformer(new MetricRegistry(), localNpiLookup); + new InpatientClaimTransformer(new MetricRegistry(), localNpiLookup, securityTagManager); ExplanationOfBenefit inpatientEob = claimTransformerInterface.transform(getClaim(InpatientClaim.class), false); String inpatientClaimType = TransformerUtils.getClaimType(inpatientEob).toString(); claimTransformerInterface = - new OutpatientClaimTransformer(new MetricRegistry(), localNpiLookup); + new OutpatientClaimTransformer(new MetricRegistry(), localNpiLookup, securityTagManager); ExplanationOfBenefit outpatientEob = claimTransformerInterface.transform(getClaim(OutpatientClaim.class), false); String outpatientClaimType = TransformerUtils.getClaimType(outpatientEob).toString(); claimTransformerInterface = - new DMEClaimTransformer(new MetricRegistry(), drugCodeDisplayLookup); + new DMEClaimTransformer(new MetricRegistry(), drugCodeDisplayLookup, securityTagManager); ExplanationOfBenefit dmeEob = claimTransformerInterface.transform(getClaim(DMEClaim.class), false); String dmeClaimType = TransformerUtils.getClaimType(dmeEob).toString(); - claimTransformerInterface = new HHAClaimTransformer(new MetricRegistry(), localNpiLookup); + claimTransformerInterface = + new HHAClaimTransformer(new MetricRegistry(), localNpiLookup, securityTagManager); ExplanationOfBenefit hhaEob = claimTransformerInterface.transform(getClaim(HHAClaim.class), false); String hhaClaimType = TransformerUtils.getClaimType(hhaEob).toString(); - claimTransformerInterface = new HospiceClaimTransformer(new MetricRegistry(), localNpiLookup); + claimTransformerInterface = + new HospiceClaimTransformer(new MetricRegistry(), localNpiLookup, securityTagManager); ExplanationOfBenefit hospiceEob = claimTransformerInterface.transform(getClaim(HospiceClaim.class), false); String hospiceClaimType = TransformerUtils.getClaimType(hospiceEob).toString(); - claimTransformerInterface = new SNFClaimTransformer(new MetricRegistry(), localNpiLookup); + claimTransformerInterface = + new SNFClaimTransformer(new MetricRegistry(), localNpiLookup, securityTagManager); ExplanationOfBenefit snfEob = claimTransformerInterface.transform(getClaim(SNFClaim.class), false); String snfClaimType = TransformerUtils.getClaimType(snfEob).toString(); claimTransformerInterface = - new CarrierClaimTransformer(new MetricRegistry(), drugCodeDisplayLookup, localNpiLookup); + new CarrierClaimTransformer( + new MetricRegistry(), drugCodeDisplayLookup, localNpiLookup, securityTagManager); ExplanationOfBenefit carrierEob = claimTransformerInterface.transform(getClaim(CarrierClaim.class), false); String carrierClaimType = TransformerUtils.getClaimType(carrierEob).toString(); diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/SecurityTagManagerTest.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/SecurityTagManagerTest.java new file mode 100644 index 0000000000..c6c5d7ccda --- /dev/null +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/SecurityTagManagerTest.java @@ -0,0 +1,76 @@ +package gov.cms.bfd.server.war.stu3.providers; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.*; + +import gov.cms.bfd.model.rif.samhsa.CarrierTag; +import gov.cms.bfd.model.rif.samhsa.HospiceTag; +import gov.cms.bfd.server.war.commons.SecurityTagManager; +import jakarta.persistence.EntityManager; +import jakarta.persistence.Query; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import org.hl7.fhir.r4.model.CodeableConcept; +import org.hl7.fhir.r4.model.Coding; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; + +/** securityTagManager test. */ +class SecurityTagManagerTest { + + /** The EntityManager. */ + @Mock private EntityManager entityManager; + + /** Query. */ + @Mock private Query query; + + /** securityTagManager. */ + @InjectMocks private SecurityTagManager securityTagManager; + + /** Set up the mocks and the validator being tested. */ + @BeforeEach + void setUp() { + MockitoAnnotations.openMocks(this); // Initialize mocks + } + + /** testGetClaimSecurityLevel_Inpatient. */ + @Test + void testGetClaimSecurityLevelInpatient() { + CodeableConcept type = new CodeableConcept(); + type.addCoding().setCode("INP"); + + Set mockTags = new HashSet<>(); + mockTags.add("R"); + when(entityManager.createQuery(anyString())).thenReturn(query); + when(query.getResultList()).thenReturn(new java.util.ArrayList<>(mockTags)); + + List securityLevel = + securityTagManager.getClaimSecurityLevel("12345", CarrierTag.class); + assertEquals( + "Restricted", + securityLevel.getFirst().getDisplay(), + "Security level should be 'Restricted' for Inpatient claim with 'R' tag"); + } + + /** testGetClaimSecurityLevel_Outpatient. */ + @Test + void testGetClaimSecurityLevelOutpatient() { + CodeableConcept type = new CodeableConcept(); + type.addCoding().setCode("OUT"); + + Set mockTags = new HashSet<>(); + when(entityManager.createQuery(anyString())).thenReturn(query); + when(query.getResultList()).thenReturn(new java.util.ArrayList<>(mockTags)); + + List securityLevel = + securityTagManager.getClaimSecurityLevel("67890", HospiceTag.class); + assertEquals( + "Normal", + securityLevel.getFirst().getDisplay(), + "Security level should be 'Normal' for Outpatient claim with 'NormalTag'"); + } +} diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/Stu3EobSamhsaMatcherTest.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/Stu3EobSamhsaMatcherTest.java index 93787a0804..4074b749ad 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/Stu3EobSamhsaMatcherTest.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/Stu3EobSamhsaMatcherTest.java @@ -19,6 +19,7 @@ import gov.cms.bfd.server.war.commons.CCWUtils; import gov.cms.bfd.server.war.commons.ClaimType; import gov.cms.bfd.server.war.commons.IcdCode; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.TransformerConstants; import gov.cms.bfd.server.war.utils.RDATestUtils; import java.io.IOException; @@ -38,6 +39,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import org.mockito.Mock; import org.mockito.MockedStatic; import org.mockito.junit.jupiter.MockitoExtension; import org.mockito.junit.jupiter.MockitoSettings; @@ -52,6 +54,10 @@ @ExtendWith(MockitoExtension.class) @MockitoSettings(strictness = Strictness.LENIENT) public final class Stu3EobSamhsaMatcherTest { + + /** The securityTagManager. */ + @Mock private SecurityTagManager securityTagManager; + /** The SAMHSA CPT code. */ public static final String SAMPLE_SAMHSA_CPT_CODE = "G0137"; @@ -184,7 +190,12 @@ public void nonSamhsaRelatedClaims() throws IOException { if (r instanceof Beneficiary || r instanceof BeneficiaryHistory) return null; return TransformerTestUtils.transformRifRecordToEob( - r, new MetricRegistry(), false, fdaDrugCodeDisplayLookup, localNpiLookup); + r, + new MetricRegistry(), + false, + fdaDrugCodeDisplayLookup, + localNpiLookup, + securityTagManager); }) .filter(ExplanationOfBenefit.class::isInstance) .collect(Collectors.toList()); @@ -865,7 +876,8 @@ private ExplanationOfBenefit getSampleAClaim(ClaimType claimType) throws IOExcep new MetricRegistry(), false, RDATestUtils.fdaDrugCodeDisplayLookup(), - NPIOrgLookup.createNpiOrgLookup()); + NPIOrgLookup.createNpiOrgLookup(), + securityTagManager); return sampleEobForClaimType; } diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/TransformerTestUtils.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/TransformerTestUtils.java index f93fd63838..4e53a38ee4 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/TransformerTestUtils.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/TransformerTestUtils.java @@ -40,6 +40,7 @@ import gov.cms.bfd.server.war.commons.Diagnosis; import gov.cms.bfd.server.war.commons.IdentifierType; import gov.cms.bfd.server.war.commons.MedicareSegment; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.TransformerConstants; import gov.cms.bfd.server.war.utils.RDATestUtils; import gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException; @@ -2242,6 +2243,7 @@ static void assertLastUpdatedEquals( * @param includeTaxNumbers if tax numbers should be included in the response * @param drugCodeDisplayLookup the drug code display lookup * @param npiOrgLookup the npi org lookup + * @param securityTagManager SamhsaSecurityTag lookup * @return the transformed {@link ExplanationOfBenefit} for the specified RIF record */ static ExplanationOfBenefit transformRifRecordToEob( @@ -2249,26 +2251,34 @@ static ExplanationOfBenefit transformRifRecordToEob( MetricRegistry metricRegistry, Boolean includeTaxNumbers, FdaDrugCodeDisplayLookup drugCodeDisplayLookup, - NPIOrgLookup npiOrgLookup) { + NPIOrgLookup npiOrgLookup, + SecurityTagManager securityTagManager) { ClaimTransformerInterface claimTransformerInterface = null; if (rifRecord instanceof CarrierClaim) { claimTransformerInterface = - new CarrierClaimTransformer(metricRegistry, drugCodeDisplayLookup, npiOrgLookup); + new CarrierClaimTransformer( + metricRegistry, drugCodeDisplayLookup, npiOrgLookup, securityTagManager); } else if (rifRecord instanceof DMEClaim) { - claimTransformerInterface = new DMEClaimTransformer(metricRegistry, drugCodeDisplayLookup); + claimTransformerInterface = + new DMEClaimTransformer(metricRegistry, drugCodeDisplayLookup, securityTagManager); } else if (rifRecord instanceof HHAClaim) { - claimTransformerInterface = new HHAClaimTransformer(metricRegistry, npiOrgLookup); + claimTransformerInterface = + new HHAClaimTransformer(metricRegistry, npiOrgLookup, securityTagManager); } else if (rifRecord instanceof HospiceClaim) { - claimTransformerInterface = new HospiceClaimTransformer(metricRegistry, npiOrgLookup); + claimTransformerInterface = + new HospiceClaimTransformer(metricRegistry, npiOrgLookup, securityTagManager); } else if (rifRecord instanceof InpatientClaim) { - claimTransformerInterface = new InpatientClaimTransformer(metricRegistry, npiOrgLookup); + claimTransformerInterface = + new InpatientClaimTransformer(metricRegistry, npiOrgLookup, securityTagManager); } else if (rifRecord instanceof OutpatientClaim) { - claimTransformerInterface = new OutpatientClaimTransformer(metricRegistry, npiOrgLookup); + claimTransformerInterface = + new OutpatientClaimTransformer(metricRegistry, npiOrgLookup, securityTagManager); } else if (rifRecord instanceof PartDEvent) { claimTransformerInterface = new PartDEventTransformer(metricRegistry, drugCodeDisplayLookup); } else if (rifRecord instanceof SNFClaim) { - claimTransformerInterface = new SNFClaimTransformer(metricRegistry, npiOrgLookup); + claimTransformerInterface = + new SNFClaimTransformer(metricRegistry, npiOrgLookup, securityTagManager); } else { throw new BadCodeMonkeyException("Unhandled RifRecord type!"); } diff --git a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/TransformerUtilsTest.java b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/TransformerUtilsTest.java index 208c2ab66f..5c73992e99 100644 --- a/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/TransformerUtilsTest.java +++ b/apps/bfd-server/bfd-server-war/src/test/java/gov/cms/bfd/server/war/stu3/providers/TransformerUtilsTest.java @@ -29,6 +29,7 @@ import gov.cms.bfd.server.war.commons.IdentifierType; import gov.cms.bfd.server.war.commons.OffsetLinkBuilder; import gov.cms.bfd.server.war.commons.QueryUtils; +import gov.cms.bfd.server.war.commons.SecurityTagManager; import gov.cms.bfd.server.war.commons.TransformerConstants; import gov.cms.bfd.server.war.utils.RDATestUtils; import java.io.IOException; @@ -54,6 +55,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; import org.mockito.MockedStatic; import org.mockito.junit.jupiter.MockitoExtension; import org.mockito.junit.jupiter.MockitoSettings; @@ -69,6 +71,9 @@ public final class TransformerUtilsTest { /** The NPI org lookup to use for the test. */ private MockedStatic npiOrgLookup; + /** The securityTagManager. */ + @Mock private SecurityTagManager securityTagManager; + /** One-time setup of objects that are normally injected. */ @BeforeEach public void setup() { @@ -439,7 +444,8 @@ public void createBundleWithoutPaging() throws IOException { FhirContext fhirContext = FhirContext.forDstu3(); ClaimTransformerInterface claimTransformerInterface = - new HHAClaimTransformer(new MetricRegistry(), NPIOrgLookup.createNpiOrgLookup()); + new HHAClaimTransformer( + new MetricRegistry(), NPIOrgLookup.createNpiOrgLookup(), securityTagManager); ExplanationOfBenefit genEob = claimTransformerInterface.transform(claim, false); IParser parser = fhirContext.newJsonParser(); String json = parser.encodeResourceToString(genEob); @@ -496,7 +502,7 @@ public void createBundleWithPagingWithASizeOf2() throws IOException { MetricRegistry metricRegistry = new MetricRegistry(); ClaimTransformerInterface claimTransformerInterface = - new HHAClaimTransformer(metricRegistry, localNpiLookup); + new HHAClaimTransformer(metricRegistry, localNpiLookup, securityTagManager); ExplanationOfBenefit genEob = claimTransformerInterface.transform(hhaClaim, false); IParser parser = fhirContext.newJsonParser(); @@ -512,7 +518,8 @@ public void createBundleWithPagingWithASizeOf2() throws IOException { .get(); hospiceClaim.setLastUpdated(Instant.now()); - claimTransformerInterface = new HospiceClaimTransformer(metricRegistry, localNpiLookup); + claimTransformerInterface = + new HospiceClaimTransformer(metricRegistry, localNpiLookup, securityTagManager); genEob = claimTransformerInterface.transform(hospiceClaim, false); parser = fhirContext.newJsonParser(); json = parser.encodeResourceToString(genEob); @@ -528,7 +535,8 @@ public void createBundleWithPagingWithASizeOf2() throws IOException { dmeClaim.setLastUpdated(Instant.now()); claimTransformerInterface = - new DMEClaimTransformer(metricRegistry, RDATestUtils.fdaDrugCodeDisplayLookup()); + new DMEClaimTransformer( + metricRegistry, RDATestUtils.fdaDrugCodeDisplayLookup(), securityTagManager); genEob = claimTransformerInterface.transform(dmeClaim, false); parser = fhirContext.newJsonParser(); json = parser.encodeResourceToString(genEob); @@ -543,7 +551,8 @@ public void createBundleWithPagingWithASizeOf2() throws IOException { .get(); inpatientClaim.setLastUpdated(Instant.now()); - claimTransformerInterface = new InpatientClaimTransformer(metricRegistry, localNpiLookup); + claimTransformerInterface = + new InpatientClaimTransformer(metricRegistry, localNpiLookup, securityTagManager); genEob = claimTransformerInterface.transform(inpatientClaim, false); parser = fhirContext.newJsonParser(); json = parser.encodeResourceToString(genEob); diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobByPatientIdAll.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobByPatientIdAll.json index 219da9cae1..8a2504b7fc 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobByPatientIdAll.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobByPatientIdAll.json @@ -15,7 +15,12 @@ "resourceType" : "ExplanationOfBenefit", "id" : "outpatient-1234567890", "meta" : { - "lastUpdated" : "IGNORED_FIELD" + "lastUpdated" : "IGNORED_FIELD", + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "extension" : [ { "url" : "https://bluebutton.cms.gov/resources/variables/nch_profnl_cmpnt_chrg_amt", @@ -657,7 +662,12 @@ "resourceType" : "ExplanationOfBenefit", "id" : "dme-2188888888", "meta" : { - "lastUpdated" : "IGNORED_FIELD" + "lastUpdated" : "IGNORED_FIELD", + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "ReferralRequest", @@ -1167,7 +1177,12 @@ "resourceType" : "ExplanationOfBenefit", "id" : "hha-2925555555", "meta" : { - "lastUpdated" : "IGNORED_FIELD" + "lastUpdated" : "IGNORED_FIELD", + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "extension" : [ { "url" : "https://bluebutton.cms.gov/resources/variables/clm_mdcr_non_pmt_rsn_cd", @@ -1607,7 +1622,12 @@ "resourceType" : "ExplanationOfBenefit", "id" : "inpatient-333333222222", "meta" : { - "lastUpdated" : "IGNORED_FIELD" + "lastUpdated" : "IGNORED_FIELD", + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "extension" : [ { "url" : "https://bluebutton.cms.gov/resources/variables/ime_op_clm_val_amt", @@ -2440,7 +2460,12 @@ "resourceType" : "ExplanationOfBenefit", "id" : "snf-777777777", "meta" : { - "lastUpdated" : "IGNORED_FIELD" + "lastUpdated" : "IGNORED_FIELD", + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "extension" : [ { "url" : "https://bluebutton.cms.gov/resources/variables/nch_bene_ip_ddctbl_amt", @@ -3555,7 +3580,12 @@ "resourceType" : "ExplanationOfBenefit", "id" : "carrier-9991831999", "meta" : { - "lastUpdated" : "IGNORED_FIELD" + "lastUpdated" : "IGNORED_FIELD", + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "ReferralRequest", @@ -4087,7 +4117,12 @@ "resourceType" : "ExplanationOfBenefit", "id" : "hospice-9992223422", "meta" : { - "lastUpdated" : "IGNORED_FIELD" + "lastUpdated" : "IGNORED_FIELD", + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "extension" : [ { "url" : "https://bluebutton.cms.gov/resources/variables/clm_mdcr_non_pmt_rsn_cd", diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobByPatientIdAllWithSamhsa.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobByPatientIdAllWithSamhsa.json new file mode 100644 index 0000000000..fb233701f7 --- /dev/null +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobByPatientIdAllWithSamhsa.json @@ -0,0 +1,1042 @@ +{ + "resourceType" : "Bundle", + "id" : "IGNORED_FIELD", + "meta" : { + "lastUpdated" : "IGNORED_FIELD" + }, + "type" : "searchset", + "total" : 4462, + "link" : [ { + "relation" : "first", + "url" : "https://localhost:IGNORED_FIELD/v1/fhir/ExplanationOfBenefit?_page=6&startIndex=0&_count=2&patient=567834" + }, { + "relation" : "next", + "url" : "https://localhost:IGNORED_FIELD/v1/fhir/ExplanationOfBenefit?_page=6&startIndex=2&_count=2&patient=567834" + }, { + "relation" : "last", + "url" : "https://localhost:IGNORED_FIELD/v1/fhir/ExplanationOfBenefit?_page=6&startIndex=4460&_count=2&patient=567834" + }, { + "relation" : "self", + "url" : "https://localhost:IGNORED_FIELD/v1/fhir/ExplanationOfBenefit/?_count=2&_page=6&patient=567834" + } ], + "entry" : [ { + "resource" : { + "resourceType" : "ExplanationOfBenefit", + "id" : "pde-89", + "meta" : { + "lastUpdated" : "IGNORED_FIELD" + }, + "identifier" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/pde_id", + "value" : "89" + }, { + "system" : "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value" : "900" + }, { + "system" : "https://bluebutton.cms.gov/resources/variables/rx_srvc_rfrnc_num", + "value" : "799999" + } ], + "status" : "active", + "type" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/eob-type", + "code" : "PDE" + }, { + "system" : "http://hl7.org/fhir/ex-claimtype", + "code" : "pharmacy", + "display" : "Pharmacy" + } ] + }, + "patient" : { + "reference" : "Patient/567834" + }, + "billablePeriod" : { + "start" : "2015-05-12", + "end" : "2015-05-12" + }, + "organization" : { + "identifier" : { + "type" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/sid/us-npi", + "code" : "NPI", + "display" : "National Provider Identifier" + } ] + }, + "system" : "http://hl7.org/fhir/sid/us-npi", + "value" : "1023011079" + }, + "display" : "ADVANTAGE HOME HEALTH CARE, INC." + }, + "facility" : { + "extension" : [ { + "url" : "https://bluebutton.cms.gov/resources/variables/phrmcy_srvc_type_cd", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/phrmcy_srvc_type_cd", + "code" : "01", + "display" : "Community/retail pharmacy" + } + } ], + "identifier" : { + "type" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/sid/us-npi", + "code" : "NPI", + "display" : "National Provider Identifier" + } ] + }, + "system" : "http://hl7.org/fhir/sid/us-npi", + "value" : "1023011079" + }, + "display" : "ADVANTAGE HOME HEALTH CARE, INC." + }, + "information" : [ { + "sequence" : 1, + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/information", + "code" : "https://bluebutton.cms.gov/resources/variables/daw_prod_slctn_cd", + "display" : "Dispense as Written (DAW) Product Selection Code" + } ] + }, + "code" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/daw_prod_slctn_cd", + "code" : "0", + "display" : "No Product Selection Indicated (may also have missing values)" + } ] + } + }, { + "sequence" : 2, + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/information", + "code" : "https://bluebutton.cms.gov/resources/variables/dspnsng_stus_cd", + "display" : "Dispensing Status Code" + } ] + }, + "code" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/dspnsng_stus_cd", + "code" : "P", + "display" : "Partial fill" + } ] + } + }, { + "sequence" : 3, + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/information", + "code" : "https://bluebutton.cms.gov/resources/variables/drug_cvrg_stus_cd", + "display" : "Drug Coverage Status Code" + } ] + }, + "code" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/drug_cvrg_stus_cd", + "code" : "C", + "display" : "Covered" + } ] + } + }, { + "sequence" : 4, + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/information", + "code" : "https://bluebutton.cms.gov/resources/variables/adjstmt_dltn_cd", + "display" : "Adjustment Deletion Code" + } ] + }, + "code" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/adjstmt_dltn_cd", + "code" : "A", + "display" : "Adjustment" + } ] + } + }, { + "sequence" : 5, + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/information", + "code" : "https://bluebutton.cms.gov/resources/variables/nstd_frmt_cd", + "display" : "Non-Standard Format Code" + } ] + }, + "code" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/nstd_frmt_cd", + "code" : "X", + "display" : "X12 837" + } ] + } + }, { + "sequence" : 6, + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/information", + "code" : "https://bluebutton.cms.gov/resources/variables/prcng_excptn_cd", + "display" : "Pricing Exception Code" + } ] + }, + "code" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/prcng_excptn_cd", + "code" : "M", + "display" : "Medicare is a secondary payer (MSP)" + } ] + } + }, { + "sequence" : 7, + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/information", + "code" : "https://bluebutton.cms.gov/resources/variables/ctstrphc_cvrg_cd", + "display" : "Catastrophic Coverage Code" + } ] + }, + "code" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/ctstrphc_cvrg_cd", + "code" : "C", + "display" : "Above attachment point" + } ] + } + }, { + "sequence" : 8, + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/information", + "code" : "https://bluebutton.cms.gov/resources/variables/rx_orgn_cd", + "display" : "Prescription Origination Code" + } ] + }, + "code" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/rx_orgn_cd", + "code" : "3", + "display" : "Electronic" + } ] + } + }, { + "sequence" : 9, + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/information", + "code" : "https://bluebutton.cms.gov/resources/variables/brnd_gnrc_cd", + "display" : "Brand-Generic Code Reported by Submitting Plan" + } ] + }, + "code" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/brnd_gnrc_cd", + "code" : "G", + "display" : "Generic Null/missing" + } ] + } + }, { + "sequence" : 10, + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/information", + "code" : "https://bluebutton.cms.gov/resources/variables/phrmcy_srvc_type_cd", + "display" : "Pharmacy service type code" + } ] + }, + "code" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/phrmcy_srvc_type_cd", + "code" : "01", + "display" : "Community/retail pharmacy" + } ] + } + }, { + "sequence" : 11, + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/information", + "code" : "https://bluebutton.cms.gov/resources/variables/ptnt_rsdnc_cd", + "display" : "Patient Residence Code" + } ] + }, + "code" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/ptnt_rsdnc_cd", + "code" : "02", + "display" : "Skilled Nursing Facility" + } ] + } + }, { + "sequence" : 12, + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/information", + "code" : "https://bluebutton.cms.gov/resources/variables/submsn_clr_cd", + "display" : "Submission clarification code" + } ] + }, + "code" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/submsn_clr_cd", + "code" : "08", + "display" : "Process compound for approved ingredients" + } ] + } + } ], + "careTeam" : [ { + "sequence" : 2, + "provider" : { + "identifier" : { + "system" : "http://hl7.org/fhir/sid/us-npi", + "value" : "1750384806" + }, + "display" : "DR. ROBERT BISBEE MD" + }, + "role" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/claimcareteamrole", + "code" : "primary", + "display" : "Primary provider" + } ] + } + } ], + "insurance" : { + "coverage" : { + "extension" : [ { + "url" : "https://bluebutton.cms.gov/resources/variables/plan_cntrct_rec_id", + "valueIdentifier" : { + "system" : "https://bluebutton.cms.gov/resources/variables/plan_cntrct_rec_id", + "value" : "H9999" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/plan_pbp_rec_num", + "valueIdentifier" : { + "system" : "https://bluebutton.cms.gov/resources/variables/plan_pbp_rec_num", + "value" : "020" + } + } ], + "reference" : "Coverage/part-d-567834" + } + }, + "item" : [ { + "sequence" : 1, + "careTeamLinkId" : [ 2 ], + "service" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/sid/ndc", + "code" : "000000000", + "display" : "Fake Diluent - WATER" + } ] + }, + "servicedDate" : "2015-05-12", + "quantity" : { + "extension" : [ { + "url" : "https://bluebutton.cms.gov/resources/variables/fill_num", + "valueQuantity" : { + "value" : 3 + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/days_suply_num", + "valueQuantity" : { + "value" : 30 + } + } ], + "value" : 60.0 + }, + "adjudication" : [ { + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/cvrd_d_plan_pd_amt", + "display" : "Amount paid by Part D plan for the PDE (drug is covered by Part D)" + } ] + }, + "reason" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/drug_cvrg_stus_cd", + "code" : "C", + "display" : "Covered" + } ] + }, + "amount" : { + "value" : 126.99, + "system" : "urn:iso:std:iso:4217", + "code" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/gdc_blw_oopt_amt", + "display" : "Gross Drug Cost Below Part D Out-of-Pocket Threshold (GDCB)" + } ] + }, + "amount" : { + "value" : 995.34, + "system" : "urn:iso:std:iso:4217", + "code" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/gdc_abv_oopt_amt", + "display" : "Gross Drug Cost Above Part D Out-of-Pocket Threshold (GDCA)" + } ] + }, + "amount" : { + "value" : 15.25, + "system" : "urn:iso:std:iso:4217", + "code" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/ptnt_pay_amt", + "display" : "Amount Paid by Patient" + } ] + }, + "amount" : { + "value" : 235.85, + "system" : "urn:iso:std:iso:4217", + "code" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/othr_troop_amt", + "display" : "Other True Out-of-Pocket (TrOOP) Amount" + } ] + }, + "amount" : { + "value" : 17.3, + "system" : "urn:iso:std:iso:4217", + "code" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/lics_amt", + "display" : "Amount paid for the PDE by Part D low income subsidy" + } ] + }, + "amount" : { + "value" : 122.23, + "system" : "urn:iso:std:iso:4217", + "code" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/plro_amt", + "display" : "Reduction in patient liability due to payments by other payers (PLRO)" + } ] + }, + "amount" : { + "value" : 42.42, + "system" : "urn:iso:std:iso:4217", + "code" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/tot_rx_cst_amt", + "display" : "Total drug cost (Part D)" + } ] + }, + "amount" : { + "value" : 550.0, + "system" : "urn:iso:std:iso:4217", + "code" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/rptd_gap_dscnt_num", + "display" : "Gap Discount Amount" + } ] + }, + "amount" : { + "value" : 317.22, + "system" : "urn:iso:std:iso:4217", + "code" : "USD" + } + } ], + "detail" : [ { + "type" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/v3/ActCode", + "code" : "RXDINV", + "display" : "Rx dispense invoice" + } ] + } + } ] + } ], + "payment" : { + "date" : "2015-05-27" + } + } + }, { + "resource" : { + "resourceType" : "ExplanationOfBenefit", + "id" : "carrier-9991831000", + "meta" : { + "lastUpdated" : "IGNORED_FIELD", + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "42CFRPart2", + "display" : "42 CFR Part 2" + }, { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "R", + "display" : "Restricted" + } ] + }, + "contained" : [ { + "resourceType" : "ReferralRequest", + "id" : "IGNORED_FIELD", + "status" : "completed", + "subject" : { + "reference" : "Patient/567834" + }, + "requester" : { + "agent" : { + "identifier" : { + "system" : "http://hl7.org/fhir/sid/us-npi", + "value" : "8765676" + } + } + }, + "recipient" : [ { + "identifier" : { + "system" : "http://hl7.org/fhir/sid/us-npi", + "value" : "8765676" + } + } ] + }, { + "resourceType" : "Observation", + "id" : "IGNORED_FIELD", + "status" : "unknown", + "code" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/line_hct_hgb_type_cd", + "code" : "R1", + "display" : "Hemoglobin Test" + } ] + }, + "valueQuantity" : { + "value" : 42.0 + } + } ], + "extension" : [ { + "url" : "https://bluebutton.cms.gov/resources/variables/prpayamt", + "valueMoney" : { + "value" : 0.0, + "system" : "urn:iso:std:iso:4217", + "code" : "USD" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/carr_num", + "valueIdentifier" : { + "system" : "https://bluebutton.cms.gov/resources/variables/carr_num", + "value" : "61026" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/carr_clm_cntl_num", + "valueIdentifier" : { + "system" : "https://bluebutton.cms.gov/resources/variables/carr_clm_cntl_num", + "value" : "74655592568216" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/carr_clm_pmt_dnl_cd", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/carr_clm_pmt_dnl_cd", + "code" : "1", + "display" : "Physician/supplier" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/asgmntcd", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/asgmntcd", + "code" : "A", + "display" : "Assigned claim" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/clm_clncl_tril_num", + "valueIdentifier" : { + "system" : "https://bluebutton.cms.gov/resources/variables/clm_clncl_tril_num", + "value" : "0" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/carr_clm_cash_ddctbl_apld_amt", + "valueMoney" : { + "value" : 777.0, + "system" : "urn:iso:std:iso:4217", + "code" : "USD" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/nch_clm_prvdr_pmt_amt", + "valueMoney" : { + "value" : 123.45, + "system" : "urn:iso:std:iso:4217", + "code" : "USD" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/nch_clm_bene_pmt_amt", + "valueMoney" : { + "value" : 888.0, + "system" : "urn:iso:std:iso:4217", + "code" : "USD" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/nch_carr_clm_sbmtd_chrg_amt", + "valueMoney" : { + "value" : 245.04, + "system" : "urn:iso:std:iso:4217", + "code" : "USD" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/nch_carr_clm_alowd_amt", + "valueMoney" : { + "value" : 166.23, + "system" : "urn:iso:std:iso:4217", + "code" : "USD" + } + } ], + "identifier" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/clm_id", + "value" : "9991831000" + }, { + "system" : "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value" : "900" + } ], + "status" : "active", + "type" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/nch_clm_type_cd", + "code" : "71", + "display" : "Local carrier non-durable medical equipment, prosthetics, orthotics, and supplies (DMEPOS) claim" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/eob-type", + "code" : "CARRIER" + }, { + "system" : "http://hl7.org/fhir/ex-claimtype", + "code" : "professional", + "display" : "Professional" + }, { + "system" : "https://bluebutton.cms.gov/resources/variables/nch_near_line_rec_ident_cd", + "code" : "O", + "display" : "Part B physician/supplier claim record (processed by local carriers; can include DMEPOS services)" + } ] + }, + "patient" : { + "reference" : "Patient/567834" + }, + "billablePeriod" : { + "start" : "1999-10-27", + "end" : "1999-10-27" + }, + "referral" : { + "reference" : "IGNORED_FIELD" + }, + "disposition" : "1", + "information" : [ { + "sequence" : 1, + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/information", + "code" : "https://bluebutton.cms.gov/resources/variables/nch_wkly_proc_dt", + "display" : "NCH Weekly Claim Processing Date" + } ] + }, + "timingDate" : "1999-11-06" + } ], + "careTeam" : [ { + "extension" : [ { + "url" : "https://bluebutton.cms.gov/resources/variables/carr_line_prvdr_type_cd", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/carr_line_prvdr_type_cd", + "code" : "0" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/prtcptng_ind_cd", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/prtcptng_ind_cd", + "code" : "1", + "display" : "Participating" + } + }, { + "url" : "http://hl7.org/fhir/sid/us-npi", + "valueCoding" : { + "system" : "http://hl7.org/fhir/sid/us-npi", + "code" : "0000000000", + "display" : "Fake ORG Name" + } + } ], + "sequence" : 2, + "provider" : { + "identifier" : { + "system" : "http://hl7.org/fhir/sid/us-npi", + "value" : "1923124" + } + }, + "responsible" : true, + "role" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/claimcareteamrole", + "code" : "primary", + "display" : "Primary provider" + } ] + }, + "qualification" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/prvdr_spclty", + "code" : "41", + "display" : "Optometrist" + } ] + } + } ], + "diagnosis" : [ { + "sequence" : 1, + "diagnosisCodeableConcept" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/sid/icd-9-cm", + "code" : "291" + } ] + }, + "type" : [ { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/diagnosis-type", + "code" : "principal", + "display" : "The single medical diagnosis that is most relevant to the patient's chief complaint or need for treatment." + } ] + } ] + }, { + "sequence" : 2, + "diagnosisCodeableConcept" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/sid/icd-10", + "code" : "A02", + "display" : "OTHER SALMONELLA INFECTIONS" + } ] + }, + "type" : [ { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/diagnosis-type", + "code" : "principal", + "display" : "The single medical diagnosis that is most relevant to the patient's chief complaint or need for treatment." + } ] + } ] + }, { + "sequence" : 3, + "diagnosisCodeableConcept" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/sid/icd-9-cm", + "code" : "A05", + "display" : "\"OTH BACTERIAL FOODBORNE INTOXICATIONS, NEC\"" + } ] + } + }, { + "sequence" : 4, + "diagnosisCodeableConcept" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/sid/icd-10", + "code" : "B04", + "display" : "MONKEYPOX" + } ] + } + }, { + "sequence" : 5, + "diagnosisCodeableConcept" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/sid/icd-10", + "code" : "B05", + "display" : "MEASLES" + } ] + } + }, { + "sequence" : 6, + "diagnosisCodeableConcept" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/sid/icd-10", + "code" : "A52", + "display" : "LATE SYPHILIS" + } ] + } + } ], + "insurance" : { + "coverage" : { + "reference" : "Coverage/part-b-567834" + } + }, + "item" : [ { + "extension" : [ { + "url" : "https://bluebutton.cms.gov/resources/variables/carr_line_mtus_cd", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/carr_line_mtus_cd", + "code" : "3", + "display" : "Services" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/carr_line_mtus_cnt", + "valueQuantity" : { + "value" : 1 + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/betos_cd", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/betos_cd", + "code" : "T2D", + "display" : "Other tests - other" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/line_bene_prmry_pyr_cd", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/line_bene_prmry_pyr_cd", + "code" : "E", + "display" : "Workers' compensation" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/line_service_deductible", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/line_service_deductible", + "code" : "0", + "display" : "Service Subject to Deductible" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/line_hct_hgb_rslt_num", + "valueReference" : { + "reference" : "IGNORED_FIELD" + } + }, { + "url" : "http://hl7.org/fhir/sid/ndc", + "valueCoding" : { + "system" : "http://hl7.org/fhir/sid/ndc", + "code" : "000000000", + "display" : "Fake Diluent - WATER" + } + } ], + "sequence" : 6, + "careTeamLinkId" : [ 2 ], + "diagnosisLinkId" : [ 6 ], + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code" : "1", + "display" : "Medical care" + } ] + }, + "service" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/hcpcs", + "version" : "5", + "code" : "92999" + } ] + }, + "modifier" : [ { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/hcpcs", + "version" : "5", + "code" : "LT" + } ] + } ], + "servicedPeriod" : { + "start" : "1999-10-27", + "end" : "1999-10-27" + }, + "locationCodeableConcept" : { + "extension" : [ { + "url" : "https://bluebutton.cms.gov/resources/variables/prvdr_state_cd", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/prvdr_state_cd", + "code" : "IL" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/prvdr_zip", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/prvdr_zip", + "code" : "555558202" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/carr_line_prcng_lclty_cd", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/carr_line_prcng_lclty_cd", + "code" : "15", + "display" : "CONNECTICUT" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/carr_line_clia_lab_num", + "valueIdentifier" : { + "system" : "https://bluebutton.cms.gov/resources/variables/carr_line_clia_lab_num", + "value" : "BB889999AA" + } + } ], + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/line_place_of_srvc_cd", + "code" : "11", + "display" : "Office. Location, other than a hospital, skilled nursing facility (SNF), military treatment facility, community health center, State or local public health clinic, or intermediate care facility (ICF), where the health professional routinely provides health examinations, diagnosis, and treatment of illness or injury on an ambulatory basis." + } ] + }, + "quantity" : { + "value" : 1.0 + }, + "adjudication" : [ { + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/carr_line_rdcd_pmt_phys_astn_c", + "display" : "Carrier Line Reduced Payment Physician Assistant Code" + } ] + }, + "reason" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/carr_line_rdcd_pmt_phys_astn_c", + "code" : "0", + "display" : "N/A" + } ] + } + }, { + "extension" : [ { + "url" : "https://bluebutton.cms.gov/resources/variables/line_pmt_80_100_cd", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/line_pmt_80_100_cd", + "code" : "0", + "display" : "80%" + } + } ], + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/line_nch_pmt_amt", + "display" : "Line NCH Medicare Payment Amount" + } ] + }, + "amount" : { + "value" : 37.5, + "system" : "urn:iso:std:iso:4217", + "code" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/line_bene_pmt_amt", + "display" : "Line Payment Amount to Beneficiary" + } ] + }, + "amount" : { + "value" : 0.0, + "system" : "urn:iso:std:iso:4217", + "code" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/line_prvdr_pmt_amt", + "display" : "Line Provider Payment Amount" + } ] + }, + "amount" : { + "value" : 37.5, + "system" : "urn:iso:std:iso:4217", + "code" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/line_bene_ptb_ddctbl_amt", + "display" : "Line Beneficiary Part B Deductible Amount" + } ] + }, + "amount" : { + "value" : 0.0, + "system" : "urn:iso:std:iso:4217", + "code" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/line_bene_prmry_pyr_pd_amt", + "display" : "Line Primary Payer (if not Medicare) Paid Amount" + } ] + }, + "amount" : { + "value" : 0.0, + "system" : "urn:iso:std:iso:4217", + "code" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/line_coinsrnc_amt", + "display" : "Line Beneficiary Coinsurance Amount" + } ] + }, + "amount" : { + "value" : 9.57, + "system" : "urn:iso:std:iso:4217", + "code" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/line_sbmtd_chrg_amt", + "display" : "Line Submitted Charge Amount" + } ] + }, + "amount" : { + "value" : 75.0, + "system" : "urn:iso:std:iso:4217", + "code" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/line_alowd_chrg_amt", + "display" : "Line Allowed Charge Amount" + } ] + }, + "amount" : { + "value" : 47.84, + "system" : "urn:iso:std:iso:4217", + "code" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/line_prcsg_ind_cd", + "display" : "Line Processing Indicator Code" + } ] + }, + "reason" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/line_prcsg_ind_cd", + "code" : "A", + "display" : "Allowed" + } ] + } + } ] + } ], + "payment" : { + "amount" : { + "value" : 199.99, + "system" : "urn:iso:std:iso:4217", + "code" : "USD" + } + } + } + } ] +} \ No newline at end of file diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobByPatientIdPaged.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobByPatientIdPaged.json index b8da6ceb24..816b001288 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobByPatientIdPaged.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobByPatientIdPaged.json @@ -21,7 +21,12 @@ "resourceType" : "ExplanationOfBenefit", "id" : "outpatient-1234567890", "meta" : { - "lastUpdated" : "IGNORED_FIELD" + "lastUpdated" : "IGNORED_FIELD", + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "extension" : [ { "url" : "https://bluebutton.cms.gov/resources/variables/nch_profnl_cmpnt_chrg_amt", @@ -663,7 +668,12 @@ "resourceType" : "ExplanationOfBenefit", "id" : "dme-2188888888", "meta" : { - "lastUpdated" : "IGNORED_FIELD" + "lastUpdated" : "IGNORED_FIELD", + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "ReferralRequest", @@ -1173,7 +1183,12 @@ "resourceType" : "ExplanationOfBenefit", "id" : "hha-2925555555", "meta" : { - "lastUpdated" : "IGNORED_FIELD" + "lastUpdated" : "IGNORED_FIELD", + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "extension" : [ { "url" : "https://bluebutton.cms.gov/resources/variables/clm_mdcr_non_pmt_rsn_cd", @@ -1613,7 +1628,12 @@ "resourceType" : "ExplanationOfBenefit", "id" : "inpatient-333333222222", "meta" : { - "lastUpdated" : "IGNORED_FIELD" + "lastUpdated" : "IGNORED_FIELD", + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "extension" : [ { "url" : "https://bluebutton.cms.gov/resources/variables/ime_op_clm_val_amt", @@ -2446,7 +2466,12 @@ "resourceType" : "ExplanationOfBenefit", "id" : "snf-777777777", "meta" : { - "lastUpdated" : "IGNORED_FIELD" + "lastUpdated" : "IGNORED_FIELD", + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "extension" : [ { "url" : "https://bluebutton.cms.gov/resources/variables/nch_bene_ip_ddctbl_amt", @@ -3561,7 +3586,12 @@ "resourceType" : "ExplanationOfBenefit", "id" : "carrier-9991831999", "meta" : { - "lastUpdated" : "IGNORED_FIELD" + "lastUpdated" : "IGNORED_FIELD", + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "ReferralRequest", @@ -4093,7 +4123,12 @@ "resourceType" : "ExplanationOfBenefit", "id" : "hospice-9992223422", "meta" : { - "lastUpdated" : "IGNORED_FIELD" + "lastUpdated" : "IGNORED_FIELD", + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "extension" : [ { "url" : "https://bluebutton.cms.gov/resources/variables/clm_mdcr_non_pmt_rsn_cd", diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadCarrier.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadCarrier.json index 6b2d630f88..a86e2376b7 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadCarrier.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadCarrier.json @@ -2,7 +2,12 @@ "resourceType" : "ExplanationOfBenefit", "id" : "carrier-9991831999", "meta" : { - "lastUpdated" : "IGNORED_FIELD" + "lastUpdated" : "IGNORED_FIELD", + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "ReferralRequest", diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadCarrierMultipleLines.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadCarrierMultipleLines.json index 85a1709da8..0098b7ac01 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadCarrierMultipleLines.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadCarrierMultipleLines.json @@ -2,7 +2,12 @@ "resourceType" : "ExplanationOfBenefit", "id" : "carrier-9991831999", "meta" : { - "lastUpdated" : "IGNORED_FIELD" + "lastUpdated" : "IGNORED_FIELD", + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "ReferralRequest", diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadCarrierWithTaxNumbers.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadCarrierWithTaxNumbers.json index 916a8f5b97..96a72b51c6 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadCarrierWithTaxNumbers.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadCarrierWithTaxNumbers.json @@ -2,7 +2,12 @@ "resourceType" : "ExplanationOfBenefit", "id" : "carrier-9991831999", "meta" : { - "lastUpdated" : "IGNORED_FIELD" + "lastUpdated" : "IGNORED_FIELD", + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "ReferralRequest", diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadDme.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadDme.json index d6e63c4d7c..f49964daf0 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadDme.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadDme.json @@ -2,7 +2,12 @@ "resourceType" : "ExplanationOfBenefit", "id" : "dme-2188888888", "meta" : { - "lastUpdated" : "IGNORED_FIELD" + "lastUpdated" : "IGNORED_FIELD", + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "ReferralRequest", diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadDmeWithTaxNumbers.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadDmeWithTaxNumbers.json index a1981091b4..f00e015e7a 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadDmeWithTaxNumbers.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadDmeWithTaxNumbers.json @@ -2,7 +2,12 @@ "resourceType" : "ExplanationOfBenefit", "id" : "dme-2188888888", "meta" : { - "lastUpdated" : "IGNORED_FIELD" + "lastUpdated" : "IGNORED_FIELD", + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "ReferralRequest", diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadHha.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadHha.json index b7fdcf1ccd..8aa556ba78 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadHha.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadHha.json @@ -2,7 +2,12 @@ "resourceType" : "ExplanationOfBenefit", "id" : "hha-2925555555", "meta" : { - "lastUpdated" : "IGNORED_FIELD" + "lastUpdated" : "IGNORED_FIELD", + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "extension" : [ { "url" : "https://bluebutton.cms.gov/resources/variables/clm_mdcr_non_pmt_rsn_cd", diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadHospice.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadHospice.json index 9f0799aed6..74aad0e6fb 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadHospice.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadHospice.json @@ -2,7 +2,12 @@ "resourceType" : "ExplanationOfBenefit", "id" : "hospice-9992223422", "meta" : { - "lastUpdated" : "IGNORED_FIELD" + "lastUpdated" : "IGNORED_FIELD", + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "extension" : [ { "url" : "https://bluebutton.cms.gov/resources/variables/clm_mdcr_non_pmt_rsn_cd", diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadInpatient.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadInpatient.json index 03f90965ee..1e9a7b9cef 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadInpatient.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadInpatient.json @@ -2,7 +2,12 @@ "resourceType" : "ExplanationOfBenefit", "id" : "inpatient-333333222222", "meta" : { - "lastUpdated" : "IGNORED_FIELD" + "lastUpdated" : "IGNORED_FIELD", + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "extension" : [ { "url" : "https://bluebutton.cms.gov/resources/variables/ime_op_clm_val_amt", diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadOutpatient.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadOutpatient.json index 0bef57a12a..0c14ea7c5d 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadOutpatient.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadOutpatient.json @@ -2,7 +2,12 @@ "resourceType" : "ExplanationOfBenefit", "id" : "outpatient-1234567890", "meta" : { - "lastUpdated" : "IGNORED_FIELD" + "lastUpdated" : "IGNORED_FIELD", + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "extension" : [ { "url" : "https://bluebutton.cms.gov/resources/variables/nch_profnl_cmpnt_chrg_amt", diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadSnf.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadSnf.json index 3b67e8b639..41ab47807a 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadSnf.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v1/eobReadSnf.json @@ -2,7 +2,12 @@ "resourceType" : "ExplanationOfBenefit", "id" : "snf-777777777", "meta" : { - "lastUpdated" : "IGNORED_FIELD" + "lastUpdated" : "IGNORED_FIELD", + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "extension" : [ { "url" : "https://bluebutton.cms.gov/resources/variables/nch_bene_ip_ddctbl_amt", diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimFissRead.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimFissRead.json index 65c0347380..498d42d611 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimFissRead.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimFissRead.json @@ -2,7 +2,12 @@ "resourceType": "Claim", "id": "f-123456", "meta": { - "lastUpdated": "1970-08-01T00:00:00.000+00:00" + "lastUpdated": "1970-08-01T00:00:00.000+00:00", + "security" : [ { + "code" : "N", + "display" : "Normal", + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality" + } ] }, "contained": [ { diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimFissReadWithTaxNumbers.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimFissReadWithTaxNumbers.json index bdb9d72692..14c5dfa657 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimFissReadWithTaxNumbers.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimFissReadWithTaxNumbers.json @@ -2,7 +2,12 @@ "resourceType": "Claim", "id": "f-123456", "meta": { - "lastUpdated": "1970-08-01T00:00:00.000+00:00" + "lastUpdated": "1970-08-01T00:00:00.000+00:00", + "security" : [ { + "code" : "N", + "display" : "Normal", + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality" + } ] }, "contained": [ { diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimMcsRead.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimMcsRead.json index 0088f1dd09..d312804ce6 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimMcsRead.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimMcsRead.json @@ -2,7 +2,12 @@ "resourceType": "Claim", "id": "m-654321", "meta": { - "lastUpdated": "1970-01-01T00:00:04.000+00:00" + "lastUpdated": "1970-01-01T00:00:04.000+00:00", + "security" : [ { + "code" : "N", + "display" : "Normal", + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality" + } ] }, "contained": [ { diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimMcsReadWithTaxNumbers.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimMcsReadWithTaxNumbers.json index 5e62ccb459..7b5b96f167 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimMcsReadWithTaxNumbers.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimMcsReadWithTaxNumbers.json @@ -2,7 +2,12 @@ "resourceType": "Claim", "id": "m-654321", "meta": { - "lastUpdated": "1970-01-01T00:00:04.000+00:00" + "lastUpdated": "1970-01-01T00:00:04.000+00:00", + "security" : [ { + "code" : "N", + "display" : "Normal", + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality" + } ] }, "contained": [ { diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimResponseFissRead.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimResponseFissRead.json index a6f3541701..ffe84294c5 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimResponseFissRead.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimResponseFissRead.json @@ -2,7 +2,12 @@ "resourceType": "ClaimResponse", "id": "f-123456", "meta": { - "lastUpdated": "1970-01-01T00:00:00.000+00:00" + "lastUpdated": "1970-01-01T00:00:00.000+00:00", + "security" : [ { + "code" : "N", + "display" : "Normal", + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality" + } ] }, "contained": [ { diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimResponseMcsRead.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimResponseMcsRead.json index 7d2bdcdc3f..91a81b4e4a 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimResponseMcsRead.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimResponseMcsRead.json @@ -2,7 +2,12 @@ "resourceType": "ClaimResponse", "id": "m-654321", "meta": { - "lastUpdated": "1970-01-01T00:00:04.000+00:00" + "lastUpdated": "1970-01-01T00:00:04.000+00:00", + "security" : [ { + "code" : "N", + "display" : "Normal", + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality" + } ] }, "contained": [ { diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimResponseSearch.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimResponseSearch.json index 72c27c6440..17bd7a4c95 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimResponseSearch.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimResponseSearch.json @@ -18,7 +18,12 @@ "resourceType": "ClaimResponse", "id": "f-123456", "meta": { - "lastUpdated": "1970-08-01T00:00:00.000+00:00" + "lastUpdated": "1970-08-01T00:00:00.000+00:00", + "security" : [ { + "code" : "N", + "display" : "Normal", + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality" + } ] }, "contained": [ { @@ -186,7 +191,12 @@ "resourceType": "ClaimResponse", "id": "m-654323", "meta": { - "lastUpdated": "1970-01-01T00:00:04.000+00:00" + "lastUpdated": "1970-01-01T00:00:04.000+00:00", + "security" : [ { + "code" : "N", + "display" : "Normal", + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality" + } ] }, "contained": [ { diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimResponseSearchPaginated.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimResponseSearchPaginated.json index 41984fcca6..b6de6f77b4 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimResponseSearchPaginated.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimResponseSearchPaginated.json @@ -30,7 +30,12 @@ "resourceType": "ClaimResponse", "id": "m-654323", "meta": { - "lastUpdated": "1970-01-01T00:00:04.000+00:00" + "lastUpdated": "1970-01-01T00:00:04.000+00:00", + "security" : [ { + "code" : "N", + "display" : "Normal", + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality" + } ] }, "contained": [ { diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimSearch.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimSearch.json index c664387ec7..3c6be06a60 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimSearch.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimSearch.json @@ -18,7 +18,12 @@ "resourceType": "Claim", "id": "f-123456", "meta": { - "lastUpdated": "1970-08-01T00:00:00.000+00:00" + "lastUpdated": "1970-08-01T00:00:00.000+00:00", + "security" : [ { + "code" : "N", + "display" : "Normal", + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality" + } ] }, "contained": [ { @@ -492,7 +497,12 @@ "resourceType": "Claim", "id": "m-654323", "meta": { - "lastUpdated": "1970-01-01T00:00:04.000+00:00" + "lastUpdated": "1970-01-01T00:00:04.000+00:00", + "security" : [ { + "code" : "N", + "display" : "Normal", + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality" + } ] }, "contained": [ { diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimSearchPaginated.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimSearchPaginated.json index 020913b3a5..306b4c879f 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimSearchPaginated.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimSearchPaginated.json @@ -30,7 +30,12 @@ "resourceType": "Claim", "id": "m-654323", "meta": { - "lastUpdated": "1970-01-01T00:00:04.000+00:00" + "lastUpdated": "1970-01-01T00:00:04.000+00:00", + "security" : [ { + "code" : "N", + "display" : "Normal", + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality" + } ] }, "contained": [ { diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimSearchWithTaxNumbers.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimSearchWithTaxNumbers.json index d07062b3c5..487afd7424 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimSearchWithTaxNumbers.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/claimSearchWithTaxNumbers.json @@ -18,7 +18,12 @@ "resourceType": "Claim", "id": "f-123456", "meta": { - "lastUpdated": "1970-08-01T00:00:00.000+00:00" + "lastUpdated": "1970-08-01T00:00:00.000+00:00", + "security" : [ { + "code" : "N", + "display" : "Normal", + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality" + } ] }, "contained": [ { @@ -505,7 +510,12 @@ "resourceType": "Claim", "id": "m-654323", "meta": { - "lastUpdated": "1970-01-01T00:00:04.000+00:00" + "lastUpdated": "1970-01-01T00:00:04.000+00:00", + "security" : [ { + "code" : "N", + "display" : "Normal", + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality" + } ] }, "contained": [ { diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobByPatientIdAll.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobByPatientIdAll.json index 1fca0562c4..41ee942125 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobByPatientIdAll.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobByPatientIdAll.json @@ -16,7 +16,12 @@ "id" : "outpatient-1234567890", "meta" : { "lastUpdated" : "IGNORED_FIELD", - "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Outpatient-Institutional" ] + "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Outpatient-Institutional" ], + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "Organization", @@ -898,7 +903,12 @@ "id" : "dme-2188888888", "meta" : { "lastUpdated" : "IGNORED_FIELD", - "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Inpatient-Institutional" ] + "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Inpatient-Institutional" ], + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "Observation", @@ -1621,7 +1631,12 @@ "id" : "hha-2925555555", "meta" : { "lastUpdated" : "IGNORED_FIELD", - "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Professional-NonClinician" ] + "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Professional-NonClinician" ], + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "Organization", @@ -2247,7 +2262,12 @@ "id" : "inpatient-333333222222", "meta" : { "lastUpdated" : "IGNORED_FIELD", - "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Inpatient-Institutional" ] + "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Inpatient-Institutional" ], + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "Organization", @@ -3376,7 +3396,12 @@ "id" : "snf-777777777", "meta" : { "lastUpdated" : "IGNORED_FIELD", - "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Inpatient-Institutional" ] + "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Inpatient-Institutional" ], + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "Organization", @@ -4871,7 +4896,12 @@ "id" : "carrier-9991831999", "meta" : { "lastUpdated" : "IGNORED_FIELD", - "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Professional-NonClinician" ] + "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Professional-NonClinician" ], + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "Observation", @@ -5624,7 +5654,12 @@ "id" : "hospice-9992223422", "meta" : { "lastUpdated" : "IGNORED_FIELD", - "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Inpatient-Institutional" ] + "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Inpatient-Institutional" ], + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "Organization", diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobByPatientIdPaged.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobByPatientIdPaged.json index 236e7f5e3f..743ea0b866 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobByPatientIdPaged.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobByPatientIdPaged.json @@ -22,7 +22,12 @@ "id" : "outpatient-1234567890", "meta" : { "lastUpdated" : "IGNORED_FIELD", - "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Outpatient-Institutional" ] + "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Outpatient-Institutional" ], + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "Organization", @@ -904,7 +909,12 @@ "id" : "dme-2188888888", "meta" : { "lastUpdated" : "IGNORED_FIELD", - "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Inpatient-Institutional" ] + "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Inpatient-Institutional" ], + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "Observation", @@ -1627,7 +1637,12 @@ "id" : "hha-2925555555", "meta" : { "lastUpdated" : "IGNORED_FIELD", - "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Professional-NonClinician" ] + "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Professional-NonClinician" ], + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "Organization", @@ -2253,7 +2268,12 @@ "id" : "inpatient-333333222222", "meta" : { "lastUpdated" : "IGNORED_FIELD", - "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Inpatient-Institutional" ] + "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Inpatient-Institutional" ], + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "Organization", @@ -3382,7 +3402,12 @@ "id" : "snf-777777777", "meta" : { "lastUpdated" : "IGNORED_FIELD", - "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Inpatient-Institutional" ] + "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Inpatient-Institutional" ], + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "Organization", @@ -4877,7 +4902,12 @@ "id" : "carrier-9991831999", "meta" : { "lastUpdated" : "IGNORED_FIELD", - "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Professional-NonClinician" ] + "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Professional-NonClinician" ], + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "Observation", @@ -5630,7 +5660,12 @@ "id" : "hospice-9992223422", "meta" : { "lastUpdated" : "IGNORED_FIELD", - "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Inpatient-Institutional" ] + "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Inpatient-Institutional" ], + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "Organization", diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadByPatientWithSamhsa.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadByPatientWithSamhsa.json new file mode 100644 index 0000000000..7b8efef150 --- /dev/null +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadByPatientWithSamhsa.json @@ -0,0 +1,1371 @@ +{ + "resourceType" : "Bundle", + "id" : "IGNORED_FIELD", + "meta" : { + "lastUpdated" : "IGNORED_FIELD" + }, + "type" : "searchset", + "total" : 4462, + "link" : [ { + "relation" : "first", + "url" : "https://localhost:IGNORED_FIELD/v2/fhir/ExplanationOfBenefit?_page=6567834&startIndex=0&_count=2&patient=567834" + }, { + "relation" : "next", + "url" : "https://localhost:IGNORED_FIELD/v2/fhir/ExplanationOfBenefit?_page=6567834&startIndex=2&_count=2&patient=567834" + }, { + "relation" : "last", + "url" : "https://localhost:IGNORED_FIELD/v2/fhir/ExplanationOfBenefit?_page=6567834&startIndex=4460&_count=2&patient=567834" + }, { + "relation" : "self", + "url" : "https://localhost:IGNORED_FIELD/v2/fhir/ExplanationOfBenefit/?_count=2&_page=6567834&patient=567834" + } ], + "entry" : [ { + "resource" : { + "resourceType" : "ExplanationOfBenefit", + "id" : "pde-89", + "meta" : { + "lastUpdated" : "IGNORED_FIELD", + "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Pharmacy" ] + }, + "identifier" : [ { + "type" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBIdentifierType", + "code" : "uc", + "display" : "Unique Claim ID" + } ] + }, + "system" : "https://bluebutton.cms.gov/resources/variables/pde_id", + "value" : "89" + }, { + "type" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBIdentifierType", + "code" : "uc", + "display" : "Unique Claim ID" + } ] + }, + "system" : "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value" : "900" + }, { + "type" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBIdentifierType", + "code" : "uc", + "display" : "Unique Claim ID" + } ] + }, + "system" : "https://bluebutton.cms.gov/resources/variables/rx_srvc_rfrnc_num", + "value" : "799999" + } ], + "status" : "active", + "type" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/eob-type", + "code" : "PDE" + }, { + "system" : "http://terminology.hl7.org/CodeSystem/claim-type", + "code" : "pharmacy", + "display" : "Pharmacy" + } ] + }, + "use" : "claim", + "patient" : { + "reference" : "Patient/567834" + }, + "billablePeriod" : { + "start" : "2015-05-12", + "end" : "2015-05-12" + }, + "created" : "IGNORED_FIELD", + "insurer" : { + "identifier" : { + "value" : "CMS" + } + }, + "provider" : { + "identifier" : { + "system" : "https://bluebutton.cms.gov/resources/variables/prvdr_num", + "value" : "1023011079" + } + }, + "facility" : { + "extension" : [ { + "url" : "https://bluebutton.cms.gov/resources/variables/phrmcy_srvc_type_cd", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/phrmcy_srvc_type_cd", + "code" : "01", + "display" : "Community/retail pharmacy" + } + } ], + "identifier" : { + "type" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBIdentifierType", + "code" : "npi" + } ] + }, + "value" : "1023011079" + }, + "display" : "ADVANTAGE HOME HEALTH CARE, INC." + }, + "outcome" : "complete", + "careTeam" : [ { + "sequence" : 1, + "provider" : { + "identifier" : { + "type" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBIdentifierType", + "code" : "npi", + "display" : "National Provider Identifier" + } ] + }, + "value" : "1750384806" + }, + "display" : "DR. ROBERT BISBEE MD" + }, + "role" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBClaimCareTeamRole", + "code" : "prescribing", + "display" : "Prescribing provider" + } ] + } + } ], + "supportingInfo" : [ { + "sequence" : 1, + "category" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBSupportingInfoType", + "code" : "compoundcode", + "display" : "Compound Code" + } ] + }, + "code" : { + "coding" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code" : "RXDINV", + "display" : "Rx dispense invoice" + } ] + } + }, { + "sequence" : 2, + "category" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBSupportingInfoType", + "code" : "refillnum", + "display" : "Refill Number" + } ] + }, + "valueQuantity" : { + "value" : 3 + } + }, { + "sequence" : 3, + "category" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBSupportingInfoType", + "code" : "dayssupply", + "display" : "Days Supply" + } ] + }, + "valueQuantity" : { + "value" : 30 + } + }, { + "sequence" : 4, + "category" : { + "coding" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/claiminformationcategory", + "code" : "info", + "display" : "Information" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/information", + "code" : "https://bluebutton.cms.gov/resources/variables/drug_cvrg_stus_cd", + "display" : "Drug Coverage Status Code" + } ] + }, + "code" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/drug_cvrg_stus_cd", + "code" : "C", + "display" : "Covered" + } ] + } + }, { + "sequence" : 5, + "category" : { + "coding" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/claiminformationcategory", + "code" : "info", + "display" : "Information" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/information", + "code" : "https://bluebutton.cms.gov/resources/variables/daw_prod_slctn_cd", + "display" : "Dispense as Written (DAW) Product Selection Code" + } ] + }, + "code" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/daw_prod_slctn_cd", + "code" : "0", + "display" : "No Product Selection Indicated (may also have missing values)" + } ] + } + }, { + "sequence" : 6, + "category" : { + "coding" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/claiminformationcategory", + "code" : "info", + "display" : "Information" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/information", + "code" : "https://bluebutton.cms.gov/resources/variables/dspnsng_stus_cd", + "display" : "Dispensing Status Code" + } ] + }, + "code" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/dspnsng_stus_cd", + "code" : "P", + "display" : "Partial fill" + } ] + } + }, { + "sequence" : 7, + "category" : { + "coding" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/claiminformationcategory", + "code" : "info", + "display" : "Information" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/information", + "code" : "https://bluebutton.cms.gov/resources/variables/adjstmt_dltn_cd", + "display" : "Adjustment Deletion Code" + } ] + }, + "code" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/adjstmt_dltn_cd", + "code" : "A", + "display" : "Adjustment" + } ] + } + }, { + "sequence" : 8, + "category" : { + "coding" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/claiminformationcategory", + "code" : "info", + "display" : "Information" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/information", + "code" : "https://bluebutton.cms.gov/resources/variables/nstd_frmt_cd", + "display" : "Non-Standard Format Code" + } ] + }, + "code" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/nstd_frmt_cd", + "code" : "X", + "display" : "X12 837" + } ] + } + }, { + "sequence" : 9, + "category" : { + "coding" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/claiminformationcategory", + "code" : "info", + "display" : "Information" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/information", + "code" : "https://bluebutton.cms.gov/resources/variables/prcng_excptn_cd", + "display" : "Pricing Exception Code" + } ] + }, + "code" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/prcng_excptn_cd", + "code" : "M", + "display" : "Medicare is a secondary payer (MSP)" + } ] + } + }, { + "sequence" : 10, + "category" : { + "coding" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/claiminformationcategory", + "code" : "info", + "display" : "Information" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/information", + "code" : "https://bluebutton.cms.gov/resources/variables/ctstrphc_cvrg_cd", + "display" : "Catastrophic Coverage Code" + } ] + }, + "code" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/ctstrphc_cvrg_cd", + "code" : "C", + "display" : "Above attachment point" + } ] + } + }, { + "sequence" : 11, + "category" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBSupportingInfoType", + "code" : "rxorigincode", + "display" : "Rx Origin Code" + } ] + }, + "code" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/rx_orgn_cd", + "code" : "3", + "display" : "Electronic" + } ] + } + }, { + "sequence" : 12, + "category" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBSupportingInfoType", + "code" : "brandgenericcode", + "display" : "Brand Generic Code" + } ] + }, + "code" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/brnd_gnrc_cd", + "code" : "G", + "display" : "Generic Null/missing" + } ] + } + }, { + "sequence" : 13, + "category" : { + "coding" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/claiminformationcategory", + "code" : "info", + "display" : "Information" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/information", + "code" : "https://bluebutton.cms.gov/resources/variables/ptnt_rsdnc_cd", + "display" : "Patient Residence Code" + } ] + }, + "code" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/ptnt_rsdnc_cd", + "code" : "02", + "display" : "Skilled Nursing Facility" + } ] + } + }, { + "sequence" : 14, + "category" : { + "coding" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/claiminformationcategory", + "code" : "info", + "display" : "Information" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/information", + "code" : "https://bluebutton.cms.gov/resources/variables/submsn_clr_cd", + "display" : "Submission clarification code" + } ] + }, + "code" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/submsn_clr_cd", + "code" : "08", + "display" : "Process compound for approved ingredients" + } ] + } + } ], + "insurance" : [ { + "focal" : true, + "coverage" : { + "extension" : [ { + "url" : "https://bluebutton.cms.gov/resources/variables/plan_cntrct_rec_id", + "valueIdentifier" : { + "system" : "https://bluebutton.cms.gov/resources/variables/plan_cntrct_rec_id", + "value" : "H9999" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/plan_pbp_rec_num", + "valueIdentifier" : { + "system" : "https://bluebutton.cms.gov/resources/variables/plan_pbp_rec_num", + "value" : "020" + } + } ], + "reference" : "Coverage/part-d-567834" + } + } ], + "item" : [ { + "sequence" : 1, + "careTeamSequence" : [ 1 ], + "productOrService" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/sid/ndc", + "code" : "000000000", + "display" : "Fake Diluent - WATER" + } ] + }, + "servicedDate" : "2015-05-12", + "quantity" : { + "value" : 60.0 + }, + "adjudication" : [ { + "category" : { + "coding" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/adjudication", + "code" : "benefit", + "display" : "Benefit Amount" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/cvrd_d_plan_pd_amt", + "display" : "Amount paid by Part D plan for the PDE (drug is covered by Part D)" + } ] + }, + "amount" : { + "value" : 126.99, + "currency" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBAdjudication", + "code" : "coinsurance", + "display" : "Co-insurance" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/gdc_blw_oopt_amt", + "display" : "Gross Drug Cost Below Part D Out-of-Pocket Threshold (GDCB)" + } ] + }, + "amount" : { + "value" : 995.34, + "currency" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBAdjudication", + "code" : "coinsurance", + "display" : "Co-insurance" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/gdc_abv_oopt_amt", + "display" : "Gross Drug Cost Above Part D Out-of-Pocket Threshold (GDCA)" + } ] + }, + "amount" : { + "value" : 15.25, + "currency" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBAdjudication", + "code" : "paidbypatient", + "display" : "Paid by patient" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/ptnt_pay_amt", + "display" : "Amount Paid by Patient" + } ] + }, + "amount" : { + "value" : 235.85, + "currency" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBAdjudication", + "code" : "priorpayerpaid", + "display" : "Prior payer paid" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/othr_troop_amt", + "display" : "Other True Out-of-Pocket (TrOOP) Amount" + } ] + }, + "amount" : { + "value" : 17.3, + "currency" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBAdjudication", + "code" : "discount", + "display" : "Discount" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/lics_amt", + "display" : "Amount paid for the PDE by Part D low income subsidy" + } ] + }, + "amount" : { + "value" : 122.23, + "currency" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBAdjudication", + "code" : "priorpayerpaid", + "display" : "Prior payer paid" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/plro_amt", + "display" : "Reduction in patient liability due to payments by other payers (PLRO)" + } ] + }, + "amount" : { + "value" : 42.42, + "currency" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBAdjudication", + "code" : "drugcost", + "display" : "Drug Cost" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/tot_rx_cst_amt", + "display" : "Total drug cost (Part D)" + } ] + }, + "amount" : { + "value" : 550.0, + "currency" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBAdjudication", + "code" : "discount", + "display" : "Discount" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/rptd_gap_dscnt_num", + "display" : "Gap Discount Amount" + } ] + }, + "amount" : { + "value" : 317.22, + "currency" : "USD" + } + } ] + } ], + "total" : [ { + "category" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBAdjudication", + "code" : "drugcost", + "display" : "Drug Cost" + } ] + }, + "amount" : { + "value" : 550.0, + "currency" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBPayerAdjudicationStatus", + "code" : "other", + "display" : "Other" + } ] + }, + "amount" : { + "value" : 0, + "currency" : "USD" + } + } ], + "payment" : { + "date" : "2015-05-27" + } + } + }, { + "resource" : { + "resourceType" : "ExplanationOfBenefit", + "id" : "carrier-9991831000", + "meta" : { + "lastUpdated" : "IGNORED_FIELD", + "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Professional-NonClinician" ], + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code" : "42CFRPart2", + "display" : "42 CFR Part 2" + }, { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "R", + "display" : "Restricted" + } ] + }, + "contained" : [ { + "resourceType" : "Observation", + "id" : "line-observation-6", + "status" : "unknown", + "code" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/line_hct_hgb_type_cd", + "code" : "R1", + "display" : "Hemoglobin Test" + } ] + }, + "valueQuantity" : { + "value" : 42.0 + } + } ], + "extension" : [ { + "url" : "https://bluebutton.cms.gov/resources/variables/nch_near_line_rec_ident_cd", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/nch_near_line_rec_ident_cd", + "code" : "O", + "display" : "Part B physician/supplier claim record (processed by local carriers; can include DMEPOS services)" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/carr_num", + "valueIdentifier" : { + "system" : "https://bluebutton.cms.gov/resources/variables/carr_num", + "value" : "61026" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/carr_clm_cntl_num", + "valueIdentifier" : { + "system" : "https://bluebutton.cms.gov/resources/variables/carr_clm_cntl_num", + "value" : "74655592568216" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/carr_clm_pmt_dnl_cd", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/carr_clm_pmt_dnl_cd", + "code" : "1", + "display" : "Physician/supplier" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/asgmntcd", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/asgmntcd", + "code" : "A", + "display" : "Assigned claim" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/clm_clncl_tril_num", + "valueIdentifier" : { + "system" : "https://bluebutton.cms.gov/resources/variables/clm_clncl_tril_num", + "value" : "0" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/carr_clm_entry_cd", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/carr_clm_entry_cd", + "code" : "1", + "display" : "Original debit; void of original debit (If CLM_DISP_CD = 3, code 1 means voided original debit)" + } + } ], + "identifier" : [ { + "type" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBIdentifierType", + "code" : "uc", + "display" : "Unique Claim ID" + } ] + }, + "system" : "https://bluebutton.cms.gov/resources/variables/clm_id", + "value" : "9991831000" + }, { + "type" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBIdentifierType", + "code" : "uc", + "display" : "Unique Claim ID" + } ] + }, + "system" : "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value" : "900" + } ], + "status" : "active", + "type" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/nch_clm_type_cd", + "code" : "71", + "display" : "Local carrier non-durable medical equipment, prosthetics, orthotics, and supplies (DMEPOS) claim" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/eob-type", + "code" : "CARRIER" + }, { + "system" : "http://terminology.hl7.org/CodeSystem/claim-type", + "code" : "professional", + "display" : "Professional" + } ] + }, + "use" : "claim", + "patient" : { + "reference" : "Patient/567834" + }, + "billablePeriod" : { + "start" : "1999-10-27", + "end" : "1999-10-27" + }, + "created" : "IGNORED_FIELD", + "insurer" : { + "identifier" : { + "value" : "CMS" + } + }, + "provider" : { + "identifier" : { + "system" : "https://bluebutton.cms.gov/resources/variables/carr_clm_blg_npi_num", + "value" : "1234567890" + } + }, + "referral" : { + "identifier" : { + "type" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBIdentifierType", + "code" : "npi", + "display" : "National Provider Identifier" + } ] + }, + "value" : "8765676" + } + }, + "outcome" : "complete", + "disposition" : "1", + "careTeam" : [ { + "sequence" : 1, + "provider" : { + "identifier" : { + "type" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBIdentifierType", + "code" : "npi", + "display" : "National Provider Identifier" + } ] + }, + "value" : "8765676" + } + }, + "role" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBClaimCareTeamRole", + "code" : "referring", + "display" : "Referring" + } ] + } + }, { + "sequence" : 2, + "provider" : { + "identifier" : { + "type" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBIdentifierType", + "code" : "npi", + "display" : "National Provider Identifier" + } ] + }, + "value" : "K25852" + } + }, + "role" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBClaimCareTeamRole", + "code" : "referring", + "display" : "Referring" + } ] + } + }, { + "extension" : [ { + "url" : "https://bluebutton.cms.gov/resources/variables/carr_line_prvdr_type_cd", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/carr_line_prvdr_type_cd", + "code" : "0" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/prtcptng_ind_cd", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/prtcptng_ind_cd", + "code" : "1", + "display" : "Participating" + } + } ], + "sequence" : 3, + "provider" : { + "identifier" : { + "type" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBIdentifierType", + "code" : "npi", + "display" : "National Provider Identifier" + } ] + }, + "value" : "1923124" + } + }, + "responsible" : true, + "role" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBClaimCareTeamRole", + "code" : "performing", + "display" : "Performing provider" + } ] + }, + "qualification" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/prvdr_spclty", + "code" : "41", + "display" : "Optometrist" + } ] + } + }, { + "sequence" : 4, + "provider" : { + "identifier" : { + "type" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBIdentifierType", + "code" : "npi", + "display" : "National Provider Identifier" + } ] + }, + "value" : "0000000000" + }, + "display" : "Fake ORG Name" + }, + "role" : { + "coding" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code" : "primary", + "display" : "Primary provider" + } ] + } + } ], + "supportingInfo" : [ { + "sequence" : 1, + "category" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBSupportingInfoType", + "code" : "clmrecvddate", + "display" : "Claim Received Date" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/information", + "code" : "https://bluebutton.cms.gov/resources/variables/nch_wkly_proc_dt", + "display" : "NCH Weekly Claim Processing Date" + } ] + }, + "timingDate" : "1999-11-06" + }, { + "sequence" : 2, + "category" : { + "coding" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/claiminformationcategory", + "code" : "info", + "display" : "Information" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/information", + "code" : "https://bluebutton.cms.gov/resources/variables/line_hct_hgb_rslt_num", + "display" : "Hematocrit / Hemoglobin Test Results" + } ] + }, + "valueReference" : { + "reference" : "#line-observation-6" + } + } ], + "diagnosis" : [ { + "sequence" : 1, + "diagnosisCodeableConcept" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/sid/icd-9-cm", + "code" : "291" + } ] + }, + "type" : [ { + "coding" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", + "code" : "principal", + "display" : "principal" + } ] + } ] + }, { + "sequence" : 2, + "diagnosisCodeableConcept" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/sid/icd-10-cm", + "code" : "A02", + "display" : "OTHER SALMONELLA INFECTIONS" + }, { + "system" : "http://hl7.org/fhir/sid/icd-10", + "code" : "A02", + "display" : "OTHER SALMONELLA INFECTIONS" + } ] + }, + "type" : [ { + "coding" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", + "code" : "principal", + "display" : "principal" + } ] + } ] + }, { + "sequence" : 3, + "diagnosisCodeableConcept" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/sid/icd-9-cm", + "code" : "A05", + "display" : "\"OTH BACTERIAL FOODBORNE INTOXICATIONS, NEC\"" + } ] + }, + "type" : [ { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBClaimDiagnosisType", + "code" : "secondary", + "display" : "Secondary" + } ] + } ] + }, { + "sequence" : 4, + "diagnosisCodeableConcept" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/sid/icd-10-cm", + "code" : "B04", + "display" : "MONKEYPOX" + }, { + "system" : "http://hl7.org/fhir/sid/icd-10", + "code" : "B04", + "display" : "MONKEYPOX" + } ] + }, + "type" : [ { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBClaimDiagnosisType", + "code" : "secondary", + "display" : "Secondary" + } ] + } ] + }, { + "sequence" : 5, + "diagnosisCodeableConcept" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/sid/icd-10-cm", + "code" : "B05", + "display" : "MEASLES" + }, { + "system" : "http://hl7.org/fhir/sid/icd-10", + "code" : "B05", + "display" : "MEASLES" + } ] + }, + "type" : [ { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBClaimDiagnosisType", + "code" : "secondary", + "display" : "Secondary" + } ] + } ] + }, { + "sequence" : 6, + "diagnosisCodeableConcept" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/sid/icd-10-cm", + "code" : "A52", + "display" : "LATE SYPHILIS" + }, { + "system" : "http://hl7.org/fhir/sid/icd-10", + "code" : "A52", + "display" : "LATE SYPHILIS" + } ] + }, + "type" : [ { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBClaimDiagnosisType", + "code" : "secondary", + "display" : "Secondary" + } ] + } ] + } ], + "insurance" : [ { + "focal" : true, + "coverage" : { + "reference" : "Coverage/part-b-567834" + } + } ], + "item" : [ { + "extension" : [ { + "url" : "https://bluebutton.cms.gov/resources/variables/carr_line_mtus_cnt", + "valueQuantity" : { + "value" : 1 + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/carr_line_mtus_cnt", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/carr_line_mtus_cnt", + "code" : "3" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/carr_line_mtus_cd", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/carr_line_mtus_cd", + "code" : "3", + "display" : "Services" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/betos_cd", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/betos_cd", + "code" : "T2D", + "display" : "Other tests - other" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/line_bene_prmry_pyr_cd", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/line_bene_prmry_pyr_cd", + "code" : "E", + "display" : "Workers' compensation" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/line_prcsg_ind_cd", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/line_prcsg_ind_cd", + "code" : "A", + "display" : "Allowed" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/line_service_deductible", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/line_service_deductible", + "code" : "0", + "display" : "Service Subject to Deductible" + } + } ], + "sequence" : 6, + "careTeamSequence" : [ 3, 4 ], + "diagnosisSequence" : [ 6 ], + "informationSequence" : [ 2 ], + "category" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code" : "1", + "display" : "Medical care" + } ] + }, + "productOrService" : { + "extension" : [ { + "url" : "http://hl7.org/fhir/sid/ndc", + "valueCoding" : { + "system" : "http://hl7.org/fhir/sid/ndc", + "code" : "000000000", + "display" : "Fake Diluent - WATER" + } + } ], + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/hcpcs", + "code" : "92999" + } ] + }, + "modifier" : [ { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/hcpcs", + "version" : "5", + "code" : "LT" + } ] + } ], + "servicedPeriod" : { + "start" : "1999-10-27", + "end" : "1999-10-27" + }, + "locationCodeableConcept" : { + "extension" : [ { + "url" : "https://bluebutton.cms.gov/resources/variables/prvdr_state_cd", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/prvdr_state_cd", + "code" : "IL" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/prvdr_zip", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/prvdr_zip", + "code" : "555558202" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/carr_line_prcng_lclty_cd", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/carr_line_prcng_lclty_cd", + "code" : "15", + "display" : "CONNECTICUT" + } + }, { + "url" : "https://bluebutton.cms.gov/resources/variables/carr_line_clia_lab_num", + "valueIdentifier" : { + "system" : "https://bluebutton.cms.gov/resources/variables/carr_line_clia_lab_num", + "value" : "BB889999AA" + } + } ], + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/line_place_of_srvc_cd", + "code" : "11", + "display" : "Office. Location, other than a hospital, skilled nursing facility (SNF), military treatment facility, community health center, State or local public health clinic, or intermediate care facility (ICF), where the health professional routinely provides health examinations, diagnosis, and treatment of illness or injury on an ambulatory basis." + } ] + }, + "quantity" : { + "value" : 1.0 + }, + "adjudication" : [ { + "category" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBAdjudicationDiscriminator", + "code" : "denialreason", + "display" : "Denial Reason" + } ] + }, + "reason" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/variables/carr_line_rdcd_pmt_phys_astn_c", + "code" : "0", + "display" : "N/A" + } ] + } + }, { + "extension" : [ { + "url" : "https://bluebutton.cms.gov/resources/variables/line_pmt_80_100_cd", + "valueCoding" : { + "system" : "https://bluebutton.cms.gov/resources/variables/line_pmt_80_100_cd", + "code" : "0", + "display" : "80%" + } + } ], + "category" : { + "coding" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/adjudication", + "code" : "benefit", + "display" : "Benefit Amount" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/line_nch_pmt_amt", + "display" : "Line NCH Medicare Payment Amount" + } ] + }, + "amount" : { + "value" : 37.5, + "currency" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBAdjudication", + "code" : "paidtopatient", + "display" : "Paid to patient" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/line_bene_pmt_amt", + "display" : "Line Payment Amount to Beneficiary" + } ] + }, + "amount" : { + "value" : 0.0, + "currency" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBAdjudication", + "code" : "paidtoprovider", + "display" : "Paid to provider" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/line_prvdr_pmt_amt", + "display" : "Line Provider Payment Amount" + } ] + }, + "amount" : { + "value" : 37.5, + "currency" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/adjudication", + "code" : "deductible", + "display" : "Deductible" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/line_bene_ptb_ddctbl_amt", + "display" : "Line Beneficiary Part B Deductible Amount" + } ] + }, + "amount" : { + "value" : 0.0, + "currency" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBAdjudication", + "code" : "priorpayerpaid", + "display" : "Prior payer paid" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/line_bene_prmry_pyr_pd_amt", + "display" : "Line Primary Payer (if not Medicare) Paid Amount" + } ] + }, + "amount" : { + "value" : 0.0, + "currency" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBAdjudication", + "code" : "coinsurance", + "display" : "Co-insurance" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/line_coinsrnc_amt", + "display" : "Line Beneficiary Coinsurance Amount" + } ] + }, + "amount" : { + "value" : 9.57, + "currency" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/adjudication", + "code" : "submitted", + "display" : "Submitted Amount" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/line_sbmtd_chrg_amt", + "display" : "Line Submitted Charge Amount" + } ] + }, + "amount" : { + "value" : 75.0, + "currency" : "USD" + } + }, { + "category" : { + "coding" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/adjudication", + "code" : "eligible", + "display" : "Eligible Amount" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/line_alowd_chrg_amt", + "display" : "Line Allowed Charge Amount" + } ] + }, + "amount" : { + "value" : 47.84, + "currency" : "USD" + } + } ] + } ], + "total" : [ { + "category" : { + "coding" : [ { + "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBAdjudication", + "code" : "priorpayerpaid", + "display" : "Prior payer paid" + }, { + "system" : "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code" : "https://bluebutton.cms.gov/resources/variables/clm_tot_chrg_amt", + "display" : "Claim Total Charge Amount" + } ] + }, + "amount" : { + "value" : 0.0, + "currency" : "USD" + } + } ], + "payment" : { + "amount" : { + "value" : 199.99, + "currency" : "USD" + } + }, + "benefitBalance" : [ { + "category" : { + "coding" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/ex-benefitcategory", + "code" : "1", + "display" : "Medical Care" + } ] + }, + "financial" : [ { + "type" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/benefit-balance", + "code" : "https://bluebutton.cms.gov/resources/variables/carr_clm_cash_ddctbl_apld_amt", + "display" : "Carrier Claim Cash Deductible Applied Amount (sum of all line-level deductible amounts)" + } ] + }, + "usedMoney" : { + "value" : 777.0, + "currency" : "USD" + } + }, { + "type" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/benefit-balance", + "code" : "https://bluebutton.cms.gov/resources/variables/nch_clm_prvdr_pmt_amt", + "display" : "NCH Claim Provider Payment Amount" + } ] + }, + "usedMoney" : { + "value" : 123.45, + "currency" : "USD" + } + }, { + "type" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/benefit-balance", + "code" : "https://bluebutton.cms.gov/resources/variables/nch_clm_bene_pmt_amt", + "display" : "NCH Claim Payment Amount to Beneficiary" + } ] + }, + "usedMoney" : { + "value" : 888.0, + "currency" : "USD" + } + }, { + "type" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/benefit-balance", + "code" : "https://bluebutton.cms.gov/resources/variables/nch_carr_clm_sbmtd_chrg_amt", + "display" : "NCH Carrier Claim Submitted Charge Amount (sum of all line-level submitted charges)" + } ] + }, + "usedMoney" : { + "value" : 245.04, + "currency" : "USD" + } + }, { + "type" : { + "coding" : [ { + "system" : "https://bluebutton.cms.gov/resources/codesystem/benefit-balance", + "code" : "https://bluebutton.cms.gov/resources/variables/nch_carr_clm_alowd_amt", + "display" : "NCH Carrier Claim Allowed Charge Amount (sum of all line-level allowed charges)" + } ] + }, + "usedMoney" : { + "value" : 166.23, + "currency" : "USD" + } + } ] + } ] + } + } ] +} \ No newline at end of file diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadCarrier.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadCarrier.json index 25aed327fd..0bd1add680 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadCarrier.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadCarrier.json @@ -3,7 +3,12 @@ "id" : "carrier-9991831999", "meta" : { "lastUpdated" : "IGNORED_FIELD", - "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Professional-NonClinician" ] + "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Professional-NonClinician" ], + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "Observation", diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadCarrierWithMultipleLines.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadCarrierWithMultipleLines.json index 98785a3b7d..530ab71b97 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadCarrierWithMultipleLines.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadCarrierWithMultipleLines.json @@ -3,7 +3,12 @@ "id" : "carrier-9991831999", "meta" : { "lastUpdated" : "IGNORED_FIELD", - "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Professional-NonClinician" ] + "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Professional-NonClinician" ], + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "Observation", diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadCarrierWithTaxNumbers.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadCarrierWithTaxNumbers.json index 480cbe8525..275e8ec4c6 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadCarrierWithTaxNumbers.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadCarrierWithTaxNumbers.json @@ -3,7 +3,12 @@ "id" : "carrier-9991831999", "meta" : { "lastUpdated" : "IGNORED_FIELD", - "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Professional-NonClinician" ] + "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Professional-NonClinician" ], + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "Observation", diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadDme.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadDme.json index 9080451cf7..cc3891910b 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadDme.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadDme.json @@ -3,7 +3,12 @@ "id" : "dme-2188888888", "meta" : { "lastUpdated" : "IGNORED_FIELD", - "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Inpatient-Institutional" ] + "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Inpatient-Institutional" ], + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "Observation", diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadDmeWithTaxNumbers.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadDmeWithTaxNumbers.json index 19d74d6999..a38f82492f 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadDmeWithTaxNumbers.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadDmeWithTaxNumbers.json @@ -3,7 +3,12 @@ "id" : "dme-2188888888", "meta" : { "lastUpdated" : "IGNORED_FIELD", - "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Inpatient-Institutional" ] + "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Inpatient-Institutional" ], + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "Observation", diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadHha.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadHha.json index 1de9dda4f1..f0bdb33bde 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadHha.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadHha.json @@ -3,7 +3,12 @@ "id" : "hha-2925555555", "meta" : { "lastUpdated" : "IGNORED_FIELD", - "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Professional-NonClinician" ] + "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Professional-NonClinician" ], + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "Organization", diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadHospice.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadHospice.json index 75f5dfeff9..f63de3d2b0 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadHospice.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadHospice.json @@ -3,7 +3,12 @@ "id" : "hospice-9992223422", "meta" : { "lastUpdated" : "IGNORED_FIELD", - "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Inpatient-Institutional" ] + "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Inpatient-Institutional" ], + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "Organization", diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadInpatient.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadInpatient.json index 494e7014a4..391c484054 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadInpatient.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadInpatient.json @@ -3,7 +3,12 @@ "id" : "inpatient-333333222222", "meta" : { "lastUpdated" : "IGNORED_FIELD", - "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Inpatient-Institutional" ] + "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Inpatient-Institutional" ], + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "Organization", diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadOutpatient.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadOutpatient.json index 5bc81db5aa..1e5a01fe0a 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadOutpatient.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadOutpatient.json @@ -3,7 +3,12 @@ "id" : "outpatient-1234567890", "meta" : { "lastUpdated" : "IGNORED_FIELD", - "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Outpatient-Institutional" ] + "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Outpatient-Institutional" ], + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "Organization", diff --git a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadSnf.json b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadSnf.json index 4187358b5f..7b7eab516b 100644 --- a/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadSnf.json +++ b/apps/bfd-server/bfd-server-war/src/test/resources/endpoint-responses/v2/eobReadSnf.json @@ -3,7 +3,12 @@ "id" : "snf-777777777", "meta" : { "lastUpdated" : "IGNORED_FIELD", - "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Inpatient-Institutional" ] + "profile" : [ "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Inpatient-Institutional" ], + "security" : [ { + "system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code" : "N", + "display" : "Normal" + } ] }, "contained" : [ { "resourceType" : "Organization", diff --git a/apps/bfd-shared-utils/src/main/java/gov/cms/bfd/sharedutils/TagCode.java b/apps/bfd-shared-utils/src/main/java/gov/cms/bfd/sharedutils/TagCode.java new file mode 100644 index 0000000000..d0a39be73e --- /dev/null +++ b/apps/bfd-shared-utils/src/main/java/gov/cms/bfd/sharedutils/TagCode.java @@ -0,0 +1,51 @@ +package gov.cms.bfd.sharedutils; + +import lombok.Getter; + +/** ENUM of TAG codes. */ +@Getter +public enum TagCode { + /** Tag Code R. */ + R("R", "Restricted"), + /** Tag Code 42CFRPart2. */ + _42CFRPart2("42CFRPart2", "42 CFR Part 2"); + + /** Name of the enum in the DB. */ + private final String dbName; + + /** Display name. */ + private final String displayName; + + /** + * Constructor. + * + * @param dbName Sets the DB name of the enum. + * @param displayName Sets display name of the enum. + */ + TagCode(String dbName, String displayName) { + this.dbName = dbName; + this.displayName = displayName; + } + + @Override + public String toString() { + return this.dbName; + } + + /** + * Converts a string from the DB to the corresponding TagCode enum. + * + * @param text The string value from the DB. + * @return The corresponding TagCode enum, or null if no match is found. + */ + public static TagCode fromString(String text) { + if (text != null) { + for (TagCode tag : TagCode.values()) { + if (tag.dbName.equalsIgnoreCase(text)) { + return tag; + } + } + } + return null; + } +}