Skip to content

Commit

Permalink
resolves #79
Browse files Browse the repository at this point in the history
  • Loading branch information
ismael-sarmento-jr committed Sep 1, 2015
1 parent d5ed6e5 commit fa79ae1
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

import org.hibernate.envers.Audited;
Expand Down Expand Up @@ -119,6 +120,7 @@ public final class DrugExposurePrescriptionWritten extends DrugExposurePrescript
* @fhir numberOfRepeatsAllowed
*/
@Column(name="refills")
@Min(0L)
private Integer refills;

/*
Expand Down Expand Up @@ -243,8 +245,10 @@ public IResource getRelatedResource() {
resource.setId(this.getIdDt());
resource.setDateWritten(new DateTimeDt(this.startDate));
/* Begin Setting Dispense */
ResourceReferenceDt medicationRef = new ResourceReferenceDt(new IdDt("Medication", this.medication.getId()));
resource.setMedication(medicationRef);
Dispense dispense = new Dispense();
dispense.setMedication(new ResourceReferenceDt(new IdDt("Medication", this.medication.getId())));
dispense.setMedication(medicationRef);
if(this.refills != null)
dispense.setNumberOfRepeatsAllowed(this.refills);
if(this.quantity != null)
Expand Down

0 comments on commit fa79ae1

Please sign in to comment.