use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class ClinicalDocumentValidatorTest method testMissingTin.
@Test
void testMissingTin() {
Node clinicalDocumentNode = new Node(TemplateId.CLINICAL_DOCUMENT);
clinicalDocumentNode.putValue("programName", "mips");
clinicalDocumentNode.putValue("nationalProviderIdentifier", "2567891421");
Node aciSectionNode = createAciSectionNode(clinicalDocumentNode);
clinicalDocumentNode.addChildNode(aciSectionNode);
ClinicalDocumentValidator validator = new ClinicalDocumentValidator();
Set<Detail> errors = validator.validateSingleNode(clinicalDocumentNode);
assertWithMessage("there should NOT be an error").that(errors).isEmpty();
}
use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class ClinicalDocumentValidatorTest method testMissingName.
@Test
void testMissingName() {
Node clinicalDocumentNode = new Node(TemplateId.CLINICAL_DOCUMENT);
clinicalDocumentNode.putValue("taxpayerIdentificationNumber", "123456789");
clinicalDocumentNode.putValue("nationalProviderIdentifier", "2567891421");
Node aciSectionNode = createAciSectionNode(clinicalDocumentNode);
clinicalDocumentNode.addChildNode(aciSectionNode);
ClinicalDocumentValidator validator = new ClinicalDocumentValidator();
Set<Detail> errors = validator.validateSingleNode(clinicalDocumentNode);
assertWithMessage("error should be about missing missing program name").that(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(ErrorCode.CLINICAL_DOCUMENT_MISSING_PROGRAM_NAME);
}
use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class ClinicalDocumentValidatorTest method testNoSections.
@Test
void testNoSections() {
Node clinicalDocumentNode = createValidClinicalDocumentNode();
ClinicalDocumentValidator validator = new ClinicalDocumentValidator();
Set<Detail> errors = validator.validateSingleNode(clinicalDocumentNode);
assertWithMessage("error should be about missing section node").that(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(ErrorCode.CLINICAL_DOCUMENT_MISSING_ACI_OR_IA_OR_ECQM_CHILD);
}
use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class ClinicalDocumentValidatorTest method testDuplicateAciSectionCausesError.
@Test
void testDuplicateAciSectionCausesError() {
Node clinicalDocumentNode = createValidClinicalDocumentNode();
Node aciSectionNode = createAciSectionNode(clinicalDocumentNode);
Node duplicateAciSectionNode = createAciSectionNode(clinicalDocumentNode);
clinicalDocumentNode.addChildNodes(aciSectionNode, duplicateAciSectionNode);
ClinicalDocumentValidator validator = new ClinicalDocumentValidator();
Set<Detail> errors = validator.validateSingleNode(clinicalDocumentNode);
assertWithMessage("Should contain one error").that(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(ErrorCode.CLINICAL_DOCUMENT_CONTAINS_DUPLICATE_ACI_SECTIONS);
}
use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class ClinicalDocumentValidatorTest method testDuplicateIASectionCausesError.
@Test
void testDuplicateIASectionCausesError() {
Node clinicalDocumentNode = createValidClinicalDocumentNode();
Node IASectionNode = createIASectionNode(clinicalDocumentNode);
Node duplicateIASectionNode = createIASectionNode(clinicalDocumentNode);
clinicalDocumentNode.addChildNodes(IASectionNode, duplicateIASectionNode);
ClinicalDocumentValidator validator = new ClinicalDocumentValidator();
Set<Detail> errors = validator.validateSingleNode(clinicalDocumentNode);
assertWithMessage("Should contain one error").that(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(ErrorCode.CLINICAL_DOCUMENT_CONTAINS_DUPLICATE_IA_SECTIONS);
}
Aggregations