Package uk.nhs.interoperability.payloads.exceptions

Examples of uk.nhs.interoperability.payloads.exceptions.MissingMandatoryFieldException.addMissingField()


   
    // Recipients
   
    // Having at least one recipient is mandatory
    if (childScreeningFields.getRecipients()==null) {
      missingFields.addMissingField("recipients", "At least one recipient must be provided");
    } else if (childScreeningFields.getRecipients().size()==0) {
      missingFields.addMissingField("recipients", "At least one recipient must be provided");
    } else {
      // Primary Recipients
      for (DocumentRecipient recipient : childScreeningFields.getRecipients()) {
View Full Code Here


   
    // Having at least one recipient is mandatory
    if (childScreeningFields.getRecipients()==null) {
      missingFields.addMissingField("recipients", "At least one recipient must be provided");
    } else if (childScreeningFields.getRecipients().size()==0) {
      missingFields.addMissingField("recipients", "At least one recipient must be provided");
    } else {
      // Primary Recipients
      for (DocumentRecipient recipient : childScreeningFields.getRecipients()) {
        try {
          Recipient r = createRecipient(recipient);
View Full Code Here

  public static ChildPatientUniversal createPatient(ChildScreeningFields fields) throws MissingMandatoryFieldException {
    MissingMandatoryFieldException missingFields = new MissingMandatoryFieldException();
   
    // Null checks for mandatory fields
    if (fields.getPatientNHSNoTraceStatus() == null) {
      missingFields.addMissingField("PatientNHSNoTraceStatus", "The tracing status for the NHS number must be provided");
    }
    if (fields.getPatientNHSNo() == null) {
      missingFields.addMissingField("PatientNHSNo", "The patient's NHS number must be provided");
    }
    if (fields.getPatientName() == null) {
View Full Code Here

    // Null checks for mandatory fields
    if (fields.getPatientNHSNoTraceStatus() == null) {
      missingFields.addMissingField("PatientNHSNoTraceStatus", "The tracing status for the NHS number must be provided");
    }
    if (fields.getPatientNHSNo() == null) {
      missingFields.addMissingField("PatientNHSNo", "The patient's NHS number must be provided");
    }
    if (fields.getPatientName() == null) {
      missingFields.addMissingField("PatientName", "The patient's name must be provided");
    }
    if (fields.getPatientGender() == null) {
View Full Code Here

    }
    if (fields.getPatientNHSNo() == null) {
      missingFields.addMissingField("PatientNHSNo", "The patient's NHS number must be provided");
    }
    if (fields.getPatientName() == null) {
      missingFields.addMissingField("PatientName", "The patient's name must be provided");
    }
    if (fields.getPatientGender() == null) {
      missingFields.addMissingField("PatientGender", "The patient's gender must be provided");
    }
    if (fields.getPatientBirthDate() == null) {
View Full Code Here

    }
    if (fields.getPatientName() == null) {
      missingFields.addMissingField("PatientName", "The patient's name must be provided");
    }
    if (fields.getPatientGender() == null) {
      missingFields.addMissingField("PatientGender", "The patient's gender must be provided");
    }
    if (fields.getPatientBirthDate() == null) {
      missingFields.addMissingField("PatientBirthDate", "The patient's date of birth must be provided");
    }
   
View Full Code Here

    }
    if (fields.getPatientGender() == null) {
      missingFields.addMissingField("PatientGender", "The patient's gender must be provided");
    }
    if (fields.getPatientBirthDate() == null) {
      missingFields.addMissingField("PatientBirthDate", "The patient's date of birth must be provided");
    }
   
    // Check if a guardian has been provided, and if so, check all the fields are there
    boolean guardianName = fields.getGuardianName() != null;
    boolean guardianNHSNo = fields.getGuardianNHSNo() != null;
View Full Code Here

    boolean guardianTelephone = fields.getGuardianTelephone() != null;
    boolean guardianRole = fields.getGuardianRole() != null;
    boolean guardian = (guardianName || guardianNHSNo || guardianNHSNoTraceStatus || guardianAddress || guardianTelephone || guardianRole);
    if (guardian) {
      if (!guardianName) {
        missingFields.addMissingField("GuardianName", "When a guardian is specified, a name must be included");
      }
      if (!guardianNHSNo) {
        missingFields.addMissingField("GuardianNHSNo", "When a guardian is specified, an NHS number must be included");
      }
      if (!guardianNHSNoTraceStatus) {
View Full Code Here

    if (guardian) {
      if (!guardianName) {
        missingFields.addMissingField("GuardianName", "When a guardian is specified, a name must be included");
      }
      if (!guardianNHSNo) {
        missingFields.addMissingField("GuardianNHSNo", "When a guardian is specified, an NHS number must be included");
      }
      if (!guardianNHSNoTraceStatus) {
        missingFields.addMissingField("GuardianNHSNoTraceStatus", "When a guardian is specified, an NHS number trace status must be included");
      }
      if (!guardianRole) {
View Full Code Here

      }
      if (!guardianNHSNo) {
        missingFields.addMissingField("GuardianNHSNo", "When a guardian is specified, an NHS number must be included");
      }
      if (!guardianNHSNoTraceStatus) {
        missingFields.addMissingField("GuardianNHSNoTraceStatus", "When a guardian is specified, an NHS number trace status must be included");
      }
      if (!guardianRole) {
        missingFields.addMissingField("GuardianRole", "When a guardian is specified, a guardian role must be included");
      }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.