use of org.hl7.fhir.r5.elementmodel.Manager in project beneficiary-fhir-data by CMSgov.
the class ExplanationOfBenefitResourceProviderIT 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 ExplanationOfBenefitResourceProviderIT method adjustInpatientRecordForSamhsaDiagnosis.
/**
* Adjusts the first inpatient record to support samhsa.
*
* @param loadedRecords the loaded records
* @param entityManager the entity manager
*/
private void adjustInpatientRecordForSamhsaDiagnosis(List<Object> loadedRecords, EntityManager entityManager) {
InpatientClaim inpatientRifRecord = loadedRecords.stream().filter(r -> r instanceof InpatientClaim).map(r -> (InpatientClaim) r).findFirst().get();
entityManager.getTransaction().begin();
inpatientRifRecord = entityManager.find(InpatientClaim.class, inpatientRifRecord.getClaimId());
inpatientRifRecord.setDiagnosis2Code(Optional.of(Stu3EobSamhsaMatcherTest.SAMPLE_SAMHSA_ICD_9_DIAGNOSIS_CODE));
inpatientRifRecord.setDiagnosis2CodeVersion(Optional.of('9'));
entityManager.merge(inpatientRifRecord);
entityManager.getTransaction().commit();
}
use of org.hl7.fhir.r5.elementmodel.Manager in project beneficiary-fhir-data by CMSgov.
the class ExplanationOfBenefitResourceProviderIT method adjustDmeRecordForSamhsaDiagnosis.
/**
* Adjusts the first DME record to support samhsa.
*
* @param loadedRecords the loaded records
* @param entityManager the entity manager
*/
private void adjustDmeRecordForSamhsaDiagnosis(List<Object> loadedRecords, EntityManager entityManager) {
DMEClaim dmeRifRecord = loadedRecords.stream().filter(r -> r instanceof DMEClaim).map(r -> (DMEClaim) r).findFirst().get();
entityManager.getTransaction().begin();
dmeRifRecord = entityManager.find(DMEClaim.class, dmeRifRecord.getClaimId());
dmeRifRecord.setDiagnosis2Code(Optional.of(Stu3EobSamhsaMatcherTest.SAMPLE_SAMHSA_ICD_9_DIAGNOSIS_CODE));
dmeRifRecord.setDiagnosis2CodeVersion(Optional.of('9'));
entityManager.merge(dmeRifRecord);
entityManager.getTransaction().commit();
}
use of org.hl7.fhir.r5.elementmodel.Manager in project beneficiary-fhir-data by CMSgov.
the class ExplanationOfBenefitResourceProviderIT 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 ExplanationOfBenefitResourceProviderIT 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();
}
Aggregations