Example #1
0
 protected boolean isClientAnAuthority() {
   String careProviderType = idCard.getSystemInfo().getCareProvider().getType();
   Preconditions.checkState(
       CVR_NUMBER.equals(careProviderType),
       "ID Card Care provider is not a CVR. This is a programming error.");
   String clientCVR = idCard.getSystemInfo().getCareProvider().getID();
   return whitelistService.isCvrWhitelisted(clientCVR, SERVICE_NAME_DGCPR);
 }
Example #2
0
  protected boolean isPersonProtected(Person person) {
    if (person.getNavnebeskyttelsestartdato() == null) return false;

    // We have to make the guard above to avoid null being passed into the
    // Instant
    // it is converted to the beginning of the era.

    Preconditions.checkState(
        person.getNavnebeskyttelseslettedato() != null,
        "The protection end date was not present. This is most unexpected and a programming error.");

    Instant protectionStart = new Instant(person.getNavnebeskyttelsestartdato());
    Instant protectionEnd = new Instant(person.getNavnebeskyttelseslettedato());

    return protectionStart.isEqualNow()
        || (protectionStart.isBeforeNow() && protectionEnd.isAfterNow());
  }
Example #3
0
  protected AssociatedGeneralPractitionerStructureType createDummyPractitioner(
      String placeholderText) {
    Preconditions.checkNotNull(placeholderText, "placeholderText");

    AssociatedGeneralPractitionerStructureType associatedGeneralPractitioner =
        new AssociatedGeneralPractitionerStructureType();
    associatedGeneralPractitioner.setAssociatedGeneralPractitionerIdentifier(BigInteger.ZERO);
    associatedGeneralPractitioner.setAssociatedGeneralPractitionerOrganisationName(placeholderText);
    associatedGeneralPractitioner.setDistrictName(placeholderText);
    associatedGeneralPractitioner.setEmailAddressIdentifier(placeholderText + "@example.com");
    associatedGeneralPractitioner.setPostCodeIdentifier("0000");

    associatedGeneralPractitioner.setStandardAddressIdentifier(placeholderText);
    associatedGeneralPractitioner.setTelephoneSubscriberIdentifier("00000000");

    return associatedGeneralPractitioner;
  }