use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class ClinicalDocumentValidatorTest method testNoSectionsOtherChildren.
@Test
void testNoSectionsOtherChildren() {
Node clinicalDocumentNode = createValidClinicalDocumentNode();
Node placeholderNode = new Node(TemplateId.PLACEHOLDER);
clinicalDocumentNode.addChildNode(placeholderNode);
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 testDuplicateQualityMeasureSectionCausesError.
@Test
void testDuplicateQualityMeasureSectionCausesError() {
Node clinicalDocumentNode = createValidClinicalDocumentNode();
Node qualityMeasureNode = createQualityMeasureSectionNode(clinicalDocumentNode);
Node duplicateQualityMeasureNode = createQualityMeasureSectionNode(clinicalDocumentNode);
clinicalDocumentNode.addChildNodes(qualityMeasureNode, duplicateQualityMeasureNode);
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);
}
use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class ClinicalDocumentValidatorTest method testNpiIsOptional.
@Test
void testNpiIsOptional() {
Node clinicalDocumentNode = new Node(TemplateId.CLINICAL_DOCUMENT);
clinicalDocumentNode.putValue("programName", "mips");
clinicalDocumentNode.putValue("taxpayerIdentificationNumber", "123456789");
Node aciSectionNode = createAciSectionNode(clinicalDocumentNode);
clinicalDocumentNode.addChildNode(aciSectionNode);
ClinicalDocumentValidator validator = new ClinicalDocumentValidator();
Set<Detail> errors = validator.validateSingleNode(clinicalDocumentNode);
assertWithMessage("there should be no errors").that(errors).isEmpty();
}
use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class ClinicalDocumentValidatorTest method testInvalidProgramName.
@Test
void testInvalidProgramName() {
Node clinicalDocumentNode = createValidClinicalDocumentNode();
Node aciSectionNode = createAciSectionNode(clinicalDocumentNode);
clinicalDocumentNode.addChildNodes(aciSectionNode);
String invalidProgramName = "Invalid program name";
clinicalDocumentNode.putValue(ClinicalDocumentDecoder.PROGRAM_NAME, invalidProgramName);
ClinicalDocumentValidator validator = new ClinicalDocumentValidator();
Set<Detail> errors = validator.validateSingleNode(clinicalDocumentNode);
assertWithMessage("Must contain the error").that(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(ErrorCode.CLINICAL_DOCUMENT_INCORRECT_PROGRAM_NAME.format(invalidProgramName, ClinicalDocumentValidator.VALID_PROGRAM_NAMES));
}
use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class IaMeasureValidatorTest method testMissingNode.
/**
* Validate a missing child
*
* @throws Exception on test error
*/
@Test
void testMissingNode() throws Exception {
Node measureNode = new Node(TemplateId.IA_MEASURE);
IaMeasureValidator validator = new IaMeasureValidator();
Set<Detail> errors = validator.validateSingleNode(measureNode);
assertWithMessage("The INCORRECT_CHILDREN_COUNT Error is expected").that(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(ErrorCode.IA_MEASURE_INCORRECT_CHILDREN_COUNT);
}
Aggregations