use of org.hl7.fhir.r5.elementmodel.Manager in project beneficiary-fhir-data by CMSgov.
the class R4ExplanationOfBenefitResourceProviderIT method adjustCarrierClaimForSamhsaDiagnosis.
/**
* Adjusts the carrier claim to support samhsa.
*
* @param loadedRecords the loaded records
* @param entityManager the entity manager
*/
private void adjustCarrierClaimForSamhsaDiagnosis(List<Object> loadedRecords, EntityManager entityManager) {
CarrierClaim carrierRifRecord = loadedRecords.stream().filter(r -> r instanceof CarrierClaim).map(r -> (CarrierClaim) r).findFirst().get();
entityManager.getTransaction().begin();
carrierRifRecord = entityManager.find(CarrierClaim.class, carrierRifRecord.getClaimId());
carrierRifRecord.setDiagnosis2Code(Optional.of(Stu3EobSamhsaMatcherTest.SAMPLE_SAMHSA_ICD_9_DIAGNOSIS_CODE));
carrierRifRecord.setDiagnosis2CodeVersion(Optional.of('9'));
entityManager.merge(carrierRifRecord);
entityManager.getTransaction().commit();
}
use of org.hl7.fhir.r5.elementmodel.Manager in project beneficiary-fhir-data by CMSgov.
the class R4ExplanationOfBenefitResourceProviderIT method adjustOutpatientRecordForSamhsaDiagnosis.
/**
* Adjusts the first outpatient record to support samhsa.
*
* @param loadedRecords the loaded records
* @param entityManager the entity manager
*/
private void adjustOutpatientRecordForSamhsaDiagnosis(List<Object> loadedRecords, EntityManager entityManager) {
OutpatientClaim outpatientRifRecord = loadedRecords.stream().filter(r -> r instanceof OutpatientClaim).map(r -> (OutpatientClaim) r).findFirst().get();
entityManager.getTransaction().begin();
outpatientRifRecord = entityManager.find(OutpatientClaim.class, outpatientRifRecord.getClaimId());
outpatientRifRecord.setDiagnosis2Code(Optional.of(Stu3EobSamhsaMatcherTest.SAMPLE_SAMHSA_ICD_9_DIAGNOSIS_CODE));
outpatientRifRecord.setDiagnosis2CodeVersion(Optional.of('9'));
entityManager.merge(outpatientRifRecord);
entityManager.getTransaction().commit();
}
use of org.hl7.fhir.r5.elementmodel.Manager in project beneficiary-fhir-data by CMSgov.
the class R4ExplanationOfBenefitResourceProviderIT method adjustHhaRecordForSamhsaDiagnosis.
/**
* Adjusts the first HHA record to support samhsa.
*
* @param loadedRecords the loaded records
* @param entityManager the entity manager
*/
private void adjustHhaRecordForSamhsaDiagnosis(List<Object> loadedRecords, EntityManager entityManager) {
HHAClaim hhaRifRecord = loadedRecords.stream().filter(r -> r instanceof HHAClaim).map(r -> (HHAClaim) r).findFirst().get();
entityManager.getTransaction().begin();
hhaRifRecord = entityManager.find(HHAClaim.class, hhaRifRecord.getClaimId());
hhaRifRecord.setDiagnosis2Code(Optional.of(Stu3EobSamhsaMatcherTest.SAMPLE_SAMHSA_ICD_9_DIAGNOSIS_CODE));
hhaRifRecord.setDiagnosis2CodeVersion(Optional.of('9'));
entityManager.merge(hhaRifRecord);
entityManager.getTransaction().commit();
}
use of org.hl7.fhir.r5.elementmodel.Manager in project beneficiary-fhir-data by CMSgov.
the class R4ExplanationOfBenefitResourceProviderIT method adjustHospiceRecordForSamhsaDiagnosis.
/**
* Adjusts the first Hospice record to support samhsa.
*
* @param loadedRecords the loaded records
* @param entityManager the entity manager
*/
private void adjustHospiceRecordForSamhsaDiagnosis(List<Object> loadedRecords, EntityManager entityManager) {
HospiceClaim hospiceRifRecord = loadedRecords.stream().filter(r -> r instanceof HospiceClaim).map(r -> (HospiceClaim) r).findFirst().get();
entityManager.getTransaction().begin();
hospiceRifRecord = entityManager.find(HospiceClaim.class, hospiceRifRecord.getClaimId());
hospiceRifRecord.setDiagnosis2Code(Optional.of(Stu3EobSamhsaMatcherTest.SAMPLE_SAMHSA_ICD_9_DIAGNOSIS_CODE));
hospiceRifRecord.setDiagnosis2CodeVersion(Optional.of('9'));
entityManager.merge(hospiceRifRecord);
entityManager.getTransaction().commit();
}
use of org.hl7.fhir.r5.elementmodel.Manager in project beneficiary-fhir-data by CMSgov.
the class ExplanationOfBenefitResourceProviderIT method adjustSnfRecordForSamhsaDiagnosis.
/**
* Adjusts the first SNF record to support samhsa.
*
* @param loadedRecords the loaded records
* @param entityManager the entity manager
*/
private void adjustSnfRecordForSamhsaDiagnosis(List<Object> loadedRecords, EntityManager entityManager) {
SNFClaim snfRifRecord = loadedRecords.stream().filter(r -> r instanceof SNFClaim).map(r -> (SNFClaim) r).findFirst().get();
entityManager.getTransaction().begin();
snfRifRecord = entityManager.find(SNFClaim.class, snfRifRecord.getClaimId());
snfRifRecord.setDiagnosis2Code(Optional.of(Stu3EobSamhsaMatcherTest.SAMPLE_SAMHSA_ICD_9_DIAGNOSIS_CODE));
snfRifRecord.setDiagnosis2CodeVersion(Optional.of('9'));
entityManager.merge(snfRifRecord);
entityManager.getTransaction().commit();
}
Aggregations