test_class.declarator: validator = new XCNValidator()
test_class.modifier: private static final
test_class.original_string: private static final XCNValidator validator = new XCNValidator();
test_class.type: XCNValidator
test_class.var_name: validator
test_class.file: commons/ihe/xds/src/test/java/org/openehealth/ipf/commons/ihe/xds/core/validate/XCNValidatorTest.java
test_class.identifier: XCNValidatorTest
test_case.body: @Test
      public void testValidateGoodCases() throws XDSMetaDataException {
          validator.validate("11375^Welby^Marcus^J^Jr. MD^Dr^^^&1.2.840.113619.6.197&ISO");
          validator.validate("11375^^^^^^^^&1.2.840.113619.6.197&ISO");
          validator.validate("abc^^^^^^^^&1.2.840.113619.6.197&ISO");
          validator.validate("^Welby^^^^^^^");
          validator.validate("^Welby");
          validator.validate("abc");
          validator.validate("abc^^^^^^^^");
      }
test_case.class_method_signature: XCNValidatorTest.testValidateGoodCases()
test_case.full_signature: @Test public void testValidateGoodCases()
test_case.identifier: testValidateGoodCases
test_case.invocations: validate validate validate validate validate validate validate
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testValidateGoodCases()
focal_class.declarator: HD_VALIDATOR = new HDValidator()
focal_class.modifier: private static final
focal_class.original_string: private static final HDValidator HD_VALIDATOR = new HDValidator();
focal_class.type: HDValidator
focal_class.var_name: HD_VALIDATOR
focal_class.file: commons/ihe/xds/src/main/java/org/openehealth/ipf/commons/ihe/xds/core/validate/XCNValidator.java
focal_class.identifier: XCNValidator
focal_class.interfaces: implements ValueValidator
focal_class.class_method_signature: XCNValidator.validate(String hl7xcn)
focal_class.full_signature: @Override public void validate(String hl7xcn)
focal_class.identifier: validate
focal_class.modifiers: @Override public
focal_class.parameters: (String hl7xcn)
focal_class.return: void
focal_class.signature: void validate(String hl7xcn)
focal_method.body: @Override
      public void validate(String hl7xcn) throws XDSMetaDataException {
          Person person = Hl7v2Based.parse(hl7xcn, Person.class);
          metaDataAssert(person != null, PERSON_MISSING_NAME_AND_ID, hl7xcn);
  
          XCN xcn = person.getHapiObject();
          metaDataAssert(
                  isNotEmpty(xcn.getXcn1_IDNumber().getValue()) ||
                  isNotEmpty(xcn.getXcn2_FamilyName().getFn1_Surname().getValue()),
                  PERSON_MISSING_NAME_AND_ID, hl7xcn);
  
  //        Spec actually allows the assigning authority to be missing:
  //          "If component 1 (ID Number) is specified, component 9 (Assigning Authority) shall be present if available"
  //        metaDataAssert(idNumber == null || hl7hd != null, PERSON_HD_MISSING, hl7xcn);
  
  
          HD hd = xcn.getXcn9_AssigningAuthority();
          if (! HD_VALIDATOR.isEmpty(hd)) {
              HD_VALIDATOR.validate(hd, hl7xcn);
          }
      }
focal_method.class_method_signature: XCNValidator.validate(String hl7xcn)
focal_method.full_signature: @Override public void validate(String hl7xcn)
focal_method.identifier: validate
focal_method.invocations: parse metaDataAssert getHapiObject metaDataAssert isNotEmpty getValue getXcn1_IDNumber isNotEmpty getValue getFn1_Surname getXcn2_FamilyName getXcn9_AssigningAuthority isEmpty validate
focal_method.modifiers: @Override public
focal_method.parameters: (String hl7xcn)
focal_method.return: void
focal_method.signature: void validate(String hl7xcn)