Summary Table

Categories Total Count
PII 0
URL 0
DNS 0
EKL 0
IP 0
PORT 0
VsID 0
CF 0
AI 0
VPD 0
PL 0
Other 0

File Content

package gov.va.med.pbm.ampl.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.springframework.lang.Nullable;

import gov.va.med.pbm.ampl.constant.AmplConstants;
import gov.va.med.pbm.ampl.utility.StringUtility;

/**
* This class consists of properties representing a patient allergy.
*
* @author Ian Meinert, Asli Goncer
* @since 1.0
*/
public class Allergy implements Serializable {

private static final long serialVersionUID = -7788619177798333712L;

/**
* The patient id
*/
private String patientId;

/**
* The facility where the allergy was entered
*/
private Facility facility;

/**
* Yes/No indicator if the allergy reaction has been verified
*/
private String verified;

/**
* Signature of person who verified the allergy
*/
private Signature verifierSig;

/**
* Standard Term/GMR Allergy
*/
private String gmrAllergy;

/**
* The file the Standard Term/GMR Allergy entry was selected from
*/
private String gmrAllergySource;

/**
* Agent that causes the allergy reaction
*/
private String causativeAgent;

/**
* List of ingredients for the drug that causes the adverse reaction
*/
private String[] ingredients;

/**
* The associated VA drug classification
*/
private String[] drugClass;

/**
* Inidcates if the reported allergy reaction is observed by the clinician or reported by the patient
*/
private String observedHistorical;

/**
* Clinician comments
*/
private Comment[] comments;

/**
* Signature of clinician who entered the allergy
*/
private Signature originatorSig;

/**
* The category of the allergy
*/
private String category;

/**
* The status of the allergy
*/
@Nullable
private String status;

/**
* The allergy assessment status
*/
private String allergyAssessment;

/**
* Clinician comments
*/
private Comment enteredInError;

/**
* List of adverse reactions caused by the allergy
*/
private Collection<AllergyReaction> reactions;

/**
* The getter for the patientId.
*
* @return the patient Id
*/
public String getPatientId() {
return patientId;
}

/**
* The setter for the patientId.
*
* @param patientId the patient Id
*
*/
public void setPatientId(String patientId) {
this.patientId = patientId;
}

/**
* The getter for the facility.
*
* @return facility
*/
public Facility getFacility() {
return facility;
}

/**
* The setter for the facility.
*
* @param facility the facility where the allergy was entered
*
*/
public void setFacility(Facility facility) {
this.facility = facility;
}

/**
* The getter for the verified.
*
* @return the allergy verification
*/
public String getVerified() {
return verified;
}

/**
* The setter for the verified.
*
* @param verified the allergy verification
*
*/
public void setVerified(String verified) {
this.verified = verified;
}

/**
* The getter for the signature of the person who verified the allergy.
*
* @return the verifierSig
*/
public Signature getVerifierSig() {
return verifierSig;
}

/**
* The setter for the signature of the person who verified the allergy.
*
* @param verifierSig the verifierSig to set
*/
public void setVerifierSig(Signature verifierSig) {
this.verifierSig = verifierSig;
}

/**
* The getter for the Standard Term/GMR Allergy.
*
* @return the Standard Term/GMR Allergy
*/
public String getGmrAllergy() {
return gmrAllergy;
}

/**
* The setter for the Standard Term/GMR Allergy.
*
* @param gmrAllergy the Standard Term/GMR Allergy
*
*/
public void setGmrAllergy(String gmrAllergy) {
this.gmrAllergy = gmrAllergy;
}

/**
* The getter for the Standard Term/GMR Allergy Source.
*
* @return the file the Standard Term/GMR Allergy entry was selected from
*/
public String getGmrAllergySource() {
return gmrAllergySource;
}

/**
* The setter for the Standard Term/GMR Allergy Source.
*
* @param gmrAllergySource the file the Standard Term/GMR Allergy entry was selected from
*
*/
public void setGmrAllergySource(String gmrAllergySource) {
String fileEntry = new String();

Pattern pattern = Pattern.compile("^(\\d+);(\\w+\\()(\\d+.\\d+),");
Matcher matcher = pattern.matcher(gmrAllergySource);

// if the search string is in the proper format, the matcher will find something
while (matcher.find()) {
String groupThree = matcher.group(AmplConstants.NUMBER_THREE);

switch (groupThree) {
// If selected from the GMR Allergies file (120.82) display "A".
case "120.82":
fileEntry = "A";
break;
// If selected from the National Drug file (#50.6) display "N".
case "50.6":
fileEntry = "N";
break;
// If selected from the Drug Ingredients file (#50.416) display "I".
case "50.416":
fileEntry = "I";
break;
// If selected from the VA Drug Classes file (#50.605) display "C".
case "50.605":
fileEntry = "C";
break;
default:
break;
}
}
this.gmrAllergySource = fileEntry;
}

/**
* The getter for the causative agent.
*
* @return the allergy causative agent
*/
public String getCausativeAgent() {
return causativeAgent;
}

/**
* The setter for the causative agent.
*
* @param causativeAgent the allergy causative agent
*
*/
public void setCausativeAgent(String causativeAgent) {
this.causativeAgent = causativeAgent;
}

/**
* The getter for the category.
*
* @return the allergy category
*/
public String getCategory() {
return category;
}

/**
* The setter for the category.
*
* @param category the allergy category
*
*/
public void setCategory(String category) {
this.category = category;
}

/**
* Gets the Allergy Status.
*
* @return the allergy status
*/
public String getStatus() {
return status;
}

/**
* Sets the Allergy Status.
*
* @param status the allergy status
*/
public void setStatus(String status) {
this.status = status;
}

/**
* The getter for the ingredients.
*
* @return ingredients that cause the allergy
*/
public String[] getIngredients() {
return ingredients;
}

/**
* The setter for the ingredients.
*
* @param ingredients collection of allergies that cause the allergy
*
*/
public void setIngredients(String[] ingredients) {
this.ingredients = ingredients;
}

/**
* The getter for the drugClass.
*
* @return the drug class
*/
public String[] getDrugClass() {
return drugClass;
}

/**
* The setter for the drugClass.
*
* @param drugClass the drug class which causes the allergy
*
*/
public void setDrugClass(String[] drugClass) {
this.drugClass = drugClass;
}

/**
* The getter for observedHistorical.
*
* @return observed historical data
*/
public String getObservedHistorical() {
return observedHistorical;
}

/**
* The setter for observedHistorical.
*
* @param observedHistorical observed historical data
*
*/
public void setObservedHistorical(String observedHistorical) {
this.observedHistorical = observedHistorical;
}

/**
* The getter for the comments.
*
* @return comments on the allergy
*/
public Comment[] getComments() {
return comments;
}

/**
* The setter for the comments.
*
* @param comments comments on the allergy
*
*/
public void setComments(Comment[] comments) {
this.comments = comments;
}

/**
* The getter for the signature of the clinician who entered the allergy.
*
* @return the originatorSig
*/
public Signature getOriginatorSig() {
return originatorSig;
}

/**
* The setter for the signature of the clinician who entered the allergy.
*
* @param originatorSig the originatorSig to set
*/
public void setOriginatorSig(Signature originatorSig) {
this.originatorSig = originatorSig;
}

/**
* The getter for the reactions.
*
* @return Collection of AllergyReaction
*/
public Collection<AllergyReaction> getReactions() {
return reactions;
}

/**
* The setter for the reactions.
*
* @param reactions Collection of AllergyReaction
*
*/
public void setReactions(Collection<AllergyReaction> reactions) {
this.reactions = reactions;
}

/**
* gets the value for the allergyAssessment.
*
* @return the allergyAssessment
*/
public String getAllergyAssessment() {
String value = allergyAssessment;

String[] aNoKnown = new String[] { "NKA", "NKDA", "NDKA" };

if (StringUtility.clearNull(value).equals(new String())) {
value = "NO ALLERGY ASSESSMENT";
} else if (Arrays.asList(aNoKnown).contains(allergyAssessment)) {
value = "NO KNOWN DRUG ALLERGIES";
}

return value;
}

/**
* Sets the value for the allergyAssessment.
*
* @param allergyAssessment the allergyAssessment to set
*/
public void setAllergyAssessment(String allergyAssessment) {
this.allergyAssessment = allergyAssessment;
}

/**
* Gets the value for the enteredInError.
*
* @return the enteredInError
*/
public Comment getEnteredInError() {
return enteredInError;
}

/**
* Sets the value for the enteredInError.
*
* @param enteredInError the enteredInError to set
*/
public void setEnteredInError(Comment enteredInError) {
this.enteredInError = enteredInError;
}
}