def post_data(self, name=None,
                      name_type=None,
                      name_value=None,
                      name_abbrev=None,
                      scheduledBy=None,
                      dateScheduled=None,
                      dateStart=None,
                      dateEnd=None,
                      recurrenceRule_frequency=None,
                      recurrenceRule_frequency_type=None,
                      recurrenceRule_frequency_value=None,
                      recurrenceRule_frequency_abbrev=None,
                      recurrenceRule_interval=None,
                      recurrenceRule_interval_type=None,
                      recurrenceRule_interval_value=None,
                      recurrenceRule_interval_abbrev=None,
                      recurrenceRule_count=None,
                      dose_textvalue=None,
                      dose_value=None,
                      dose_unit=None,
                      dose_unit_type=None,
                      dose_unit_value=None,
                      dose_unit_abbrev=None,
                      instructions=None):
    """
    SZ: More error checking needs to be performed in this method
    """
    if dateScheduled: dateScheduled = iso8601.parse_date(dateScheduled)
    if dateStart: dateStart = iso8601.parse_date(dateStart)
    if dateEnd: dateEnd = iso8601.parse_date(dateEnd)

    try:
      medicationschedule_obj = MedicationSchedule.objects.create(name=name,
                                                                 name_type=name_type,
                                                                 name_value=name_value,
                                                                 name_abbrev=name_abbrev,
                                                                 scheduledBy=scheduledBy,
                                                                 dateScheduled=dateScheduled,
                                                                 dateStart=dateStart,
                                                                 dateEnd=dateEnd,
                                                                 recurrenceRule_frequency=recurrenceRule_frequency,
                                                                 recurrenceRule_frequency_type=recurrenceRule_frequency_type,
                                                                 recurrenceRule_frequency_value=recurrenceRule_frequency_value,
                                                                 recurrenceRule_frequency_abbrev=recurrenceRule_frequency_abbrev,
                                                                 recurrenceRule_interval=recurrenceRule_interval,
                                                                 recurrenceRule_interval_type=recurrenceRule_interval_type,
                                                                 recurrenceRule_interval_value=recurrenceRule_interval_value,
                                                                 recurrenceRule_interval_abbrev=recurrenceRule_interval_abbrev,
                                                                 recurrenceRule_count=recurrenceRule_count,
                                                                 dose_textvalue=dose_textvalue,
                                                                 dose_value=dose_value,
                                                                 dose_unit=dose_unit,
                                                                 dose_unit_type=dose_unit_type,
                                                                 dose_unit_value=dose_unit_value,
                                                                 dose_unit_abbrev=dose_unit_abbrev,
                                                                 instructions=instructions)

      return medicationschedule_obj
    except Exception, e:
      raise ValueError("problem processing medicationschedule report " + str(e))
  def post_data(self, name=None,
                      name_type=None,
                      name_value=None,
                      name_abbrev=None,
                      orderType=None,
                      orderedBy=None,
                      dateOrdered=None,
                      dateExpires=None,
                      indication=None,
                      amountOrdered_unit=None,
                      amountOrdered_textvalue=None,
                      amountOrdered_value=None,
                      amountOrdered_unit_type=None, 
                      amountOrdered_unit_value=None,
                      amountOrdered_unit_abbrev=None,
                      refills=None,
                      substitutionPermitted=None,
                      instructions=None):

    """
    SZ: More error checking needs to be performed in this method
    """

    try:
      if dateOrdered:
        """
        Elliot: 3/4 changed parse_utc_date to parse_date to handle XML:datetime
        """
        dateOrdered = iso8601.parse_date(dateOrdered)

      if dateExpires:
        """
        Elliot: 3/4 changed parse_utc_date to parse_date to handle XML:datetime
        """
        dateExpires = iso8601.parse_date(dateExpires)


      medicationorder_obj = MedicationOrder.objects.create(   
                      name=name,
                      name_type=name_type,
                      name_value=name_value,
                      name_abbrev=name_abbrev,
                      order_type=orderType,
                      ordered_by=orderedBy,
                      date_ordered=dateOrdered,
                      date_expires=dateExpires,
                      indication=indication,
                      amountordered_unit=amountOrdered_unit,
                      amountordered_textvalue=amountOrdered_textvalue,
                      amountordered_value=amountOrdered_value,
                      amountordered_unit_type=amountOrdered_unit_type, 
                      amountordered_unit_value=amountOrdered_unit_value,
                      amountordered_unit_abbrev=amountOrdered_unit_abbrev,
                      refills=refills,
                      substitution_permitted=substitutionPermitted,
                      instructions=instructions)

      return medicationorder_obj
    except Exception, e:
      raise ValueError("problem processing medicationorder report " + str(e))
예제 #3
0
    def post_data(self,
                  name=None,
                  name_type=None,
                  name_value=None,
                  name_abbrev=None,
                  orderType=None,
                  orderedBy=None,
                  dateOrdered=None,
                  dateExpires=None,
                  indication=None,
                  amountOrdered_unit=None,
                  amountOrdered_textvalue=None,
                  amountOrdered_value=None,
                  amountOrdered_unit_type=None,
                  amountOrdered_unit_value=None,
                  amountOrdered_unit_abbrev=None,
                  refills=None,
                  substitutionPermitted=None,
                  instructions=None):
        """
    SZ: More error checking needs to be performed in this method
    """

        try:
            if dateOrdered:
                """
        Elliot: 3/4 changed parse_utc_date to parse_date to handle XML:datetime
        """
                dateOrdered = iso8601.parse_date(dateOrdered)

            if dateExpires:
                """
        Elliot: 3/4 changed parse_utc_date to parse_date to handle XML:datetime
        """
                dateExpires = iso8601.parse_date(dateExpires)

            medicationorder_obj = MedicationOrder.objects.create(
                name=name,
                name_type=name_type,
                name_value=name_value,
                name_abbrev=name_abbrev,
                order_type=orderType,
                ordered_by=orderedBy,
                date_ordered=dateOrdered,
                date_expires=dateExpires,
                indication=indication,
                amountordered_unit=amountOrdered_unit,
                amountordered_textvalue=amountOrdered_textvalue,
                amountordered_value=amountOrdered_value,
                amountordered_unit_type=amountOrdered_unit_type,
                amountordered_unit_value=amountOrdered_unit_value,
                amountordered_unit_abbrev=amountOrdered_unit_abbrev,
                refills=refills,
                substitution_permitted=substitutionPermitted,
                instructions=instructions)

            return medicationorder_obj
        except Exception, e:
            raise ValueError("problem processing medicationorder report " +
                             str(e))
예제 #4
0
  def post_data(self, fileId=None, 
                      storageType=None, 
                      subject=None, 
                      from_str=None,
                      dateRecorded=None,
                      dateSent=None):

    """
    SZ: More error checking needs to be performed in this method
    """

    try:
     
      if dateRecorded:
        dateRecorded = iso8601.parse_date(dateRecorded)
      if dateSent:
        dateSent = iso8601.parse_date(dateSent)

      videomessage_obj = VideoMessage.objects.create( 
                      file_id=fileId,
                      storage_type=storageType,   
                      subject=subject, 
                      from_str=from_str,
                      date_recorded=dateRecorded,
                      date_sent=dateSent)

      return videomessage_obj
    except Exception, e:
      raise ValueError("problem processing videomessage report " + str(e))
예제 #5
0
    def post_data(self,
                  fileId=None,
                  storageType=None,
                  subject=None,
                  from_str=None,
                  dateRecorded=None,
                  dateSent=None):
        """
    SZ: More error checking needs to be performed in this method
    """

        try:

            if dateRecorded:
                dateRecorded = iso8601.parse_date(dateRecorded)
            if dateSent:
                dateSent = iso8601.parse_date(dateSent)

            videomessage_obj = VideoMessage.objects.create(
                file_id=fileId,
                storage_type=storageType,
                subject=subject,
                from_str=from_str,
                date_recorded=dateRecorded,
                date_sent=dateSent)

            return videomessage_obj
        except Exception, e:
            raise ValueError("problem processing videomessage report " +
                             str(e))
예제 #6
0
  def post_data(self,
                      name=None,
                      name_type=None,
                      name_value=None,
                      name_abbrev=None,
                      measuredBy=None,
                      dateMeasuredStart=None,
                      dateMeasuredEnd=None,
                      result_unit=None,
                      result_textvalue=None,
                      result_value=None,
                      result_unit_type=None, 
                      result_unit_value=None,
                      result_unit_abbrev=None,
                      site=None,
                      position=None,
                      technique=None,
                      comments=None):

    """
    SZ: More error checking needs to be performed in this method
    """

    if dateMeasuredStart: 
      dateMeasuredStart = iso8601.parse_date(dateMeasuredStart)

    if dateMeasuredEnd:
      dateMeasuredEnd = iso8601.parse_date(dateMeasuredEnd)

    try:
      vitals_obj = Vitals.objects.create( 
                      name=name,
                      name_type=name_type,
                      name_value=name_value,
                      name_abbrev=name_abbrev,
                      measured_by=measuredBy,
                      date_measured_start=dateMeasuredStart,
                      date_measured_end=dateMeasuredEnd,
                      result_unit=result_unit,
                      result_textvalue=result_textvalue,
                      result_value=result_value,
                      result_unit_type=result_unit_type, 
                      result_unit_value=result_unit_value,
                      result_unit_abbrev=result_unit_abbrev,
                      site=site,
                      position=position,
                      technique=technique,
                      comments=comments)

      return vitals_obj
    except Exception, e:
      raise ValueError("problem processing vitals report " + str(e))
예제 #7
0
    def post_data(self,
                  name=None,
                  name_type=None,
                  name_value=None,
                  name_abbrev=None,
                  measuredBy=None,
                  dateMeasuredStart=None,
                  dateMeasuredEnd=None,
                  result_unit=None,
                  result_textvalue=None,
                  result_value=None,
                  result_unit_type=None,
                  result_unit_value=None,
                  result_unit_abbrev=None,
                  site=None,
                  position=None,
                  technique=None,
                  comments=None):
        """
    SZ: More error checking needs to be performed in this method
    """

        if dateMeasuredStart:
            dateMeasuredStart = iso8601.parse_date(dateMeasuredStart)

        if dateMeasuredEnd:
            dateMeasuredEnd = iso8601.parse_date(dateMeasuredEnd)

        try:
            vitals_obj = Vitals.objects.create(
                name=name,
                name_type=name_type,
                name_value=name_value,
                name_abbrev=name_abbrev,
                measured_by=measuredBy,
                date_measured_start=dateMeasuredStart,
                date_measured_end=dateMeasuredEnd,
                result_unit=result_unit,
                result_textvalue=result_textvalue,
                result_value=result_value,
                result_unit_type=result_unit_type,
                result_unit_value=result_unit_value,
                result_unit_abbrev=result_unit_abbrev,
                site=site,
                position=position,
                technique=technique,
                comments=comments)

            return vitals_obj
        except Exception, e:
            raise ValueError("problem processing vitals report " + str(e))
  def post_data(self, name=None,
                      name_type=None,
                      name_value=None,
                      name_abbrev=None,
                      filledBy=None,
                      dateFilled=None,
                      amountFilled_unit=None,
                      amountFilled_textvalue=None,
                      amountFilled_value=None,
                      amountFilled_unit_type=None, 
                      amountFilled_unit_value=None,
                      amountFilled_unit_abbrev=None,
                      ndc=None,
                      ndc_type=None,
                      ndc_value=None,
                      ndc_abbrev=None,
                      fillSequenceNumber=None,
                      lotNumber=None,
                      refillsRemaining=None,
                      instructions=None):


    """
    SZ: More error checking needs to be performed in this method
    """

    try:
      if dateFilled:
        """
        Elliot: 3/4 changed parse_utc_date to parse_date to handle XML:datetime
        """
        dateFilled = iso8601.parse_date(dateFilled)

      medicationfill_obj = MedicationFill.objects.create(   
                      name=name,
                      name_type=name_type,
                      name_value=name_value,
                      name_abbrev=name_abbrev,
                      filled_by=filledBy,
                      date_filled=dateFilled,
                      amountfilled_unit=amountFilled_unit,
                      amountfilled_textvalue=amountFilled_textvalue,
                      amountfilled_value=amountFilled_value,
                      amountfilled_unit_type=amountFilled_unit_type, 
                      amountfilled_unit_value=amountFilled_unit_value,
                      amountfilled_unit_abbrev=amountFilled_unit_abbrev,
                      ndc=ndc,
                      ndc_type=ndc_type,
                      ndc_value=ndc_value,
                      ndc_abbrev=ndc_abbrev,
                      fill_sequence_number=fillSequenceNumber,
                      lot_number=lotNumber,
                      refills_remaining=refillsRemaining,
                      instructions=instructions)

      return medicationfill_obj
    except Exception, e:
      raise ValueError("problem processing medicationfill report " + str(e))
예제 #9
0
    def post_data(self,
                  name=None,
                  name_type=None,
                  name_value=None,
                  name_abbrev=None,
                  filledBy=None,
                  dateFilled=None,
                  amountFilled_unit=None,
                  amountFilled_textvalue=None,
                  amountFilled_value=None,
                  amountFilled_unit_type=None,
                  amountFilled_unit_value=None,
                  amountFilled_unit_abbrev=None,
                  ndc=None,
                  ndc_type=None,
                  ndc_value=None,
                  ndc_abbrev=None,
                  fillSequenceNumber=None,
                  lotNumber=None,
                  refillsRemaining=None,
                  instructions=None):
        """
    SZ: More error checking needs to be performed in this method
    """

        try:
            if dateFilled:
                """
        Elliot: 3/4 changed parse_utc_date to parse_date to handle XML:datetime
        """
                dateFilled = iso8601.parse_date(dateFilled)

            medicationfill_obj = MedicationFill.objects.create(
                name=name,
                name_type=name_type,
                name_value=name_value,
                name_abbrev=name_abbrev,
                filled_by=filledBy,
                date_filled=dateFilled,
                amountfilled_unit=amountFilled_unit,
                amountfilled_textvalue=amountFilled_textvalue,
                amountfilled_value=amountFilled_value,
                amountfilled_unit_type=amountFilled_unit_type,
                amountfilled_unit_value=amountFilled_unit_value,
                amountfilled_unit_abbrev=amountFilled_unit_abbrev,
                ndc=ndc,
                ndc_type=ndc_type,
                ndc_value=ndc_value,
                ndc_abbrev=ndc_abbrev,
                fill_sequence_number=fillSequenceNumber,
                lot_number=lotNumber,
                refills_remaining=refillsRemaining,
                instructions=instructions)

            return medicationfill_obj
        except Exception, e:
            raise ValueError("problem processing medicationfill report " +
                             str(e))
예제 #10
0
  def post_data(self, scheduledBy=None, 
                      dateTimeScheduled=None, 
                      dateTimeStart=None, 
                      dateTimeEnd=None,
                      frequency=None,
                      frequency_type=None,
                      frequency_value=None,
                      frequency_abbrev=None,
                      dateTimeUntil=None,
                      count=None):

    """
    SZ: More error checking needs to be performed in this method
    """

    try:
      """
      Elliot: 3/4 changed parse_utc_date to parse_date
      """
      if dateTimeScheduled:
        dateTimeScheduled = iso8601.parse_date(dateTimeScheduled)
      if dateTimeStart:
        dateTimeStart = iso8601.parse_date(dateTimeStart)
      if dateTimeEnd:
        dateTimeEnd = iso8601.parse_date(dateTimeEnd)
      if dateTimeUntil:
        dateTimeUntil = iso8601.parse_date(dateTimeUntil)

      schedulegroup_obj = ScheduleGroup.objects.create(   
                      scheduled_by=scheduledBy, 
                      datetime_scheduled=dateTimeScheduled, 
                      datetime_start=dateTimeStart, 
                      datetime_end=dateTimeEnd,
                      frequency=frequency,
                      frequency_type=frequency_type,
                      frequency_value=frequency_value,
                      frequency_abbrev=frequency_abbrev,
                      datetime_until=dateTimeUntil,
                      count=count)

      return schedulegroup_obj
    except Exception, e:
      raise ValueError("problem processing medicationscheduleitem report " + str(e))
예제 #11
0
  def post_data(self, 
    name=None,
    name_type=None,
    name_value=None,
    name_abbrev=None,
    reportedBy=None,
    dateReported=None,
    recurrenceIndex=None,
    adherence=None,
    nonadherenceReason=None):

    """
    SZ: More error checking needs to be performed in this method
    """

    try:
      """
      Elliot: 3/4 changed parse_utc_date to parse_date
      """
      if dateReported:
        dateReported = iso8601.parse_date(dateReported)

      adherenceitem_obj = AdherenceItem.objects.create(   
                            name=name,
                            name_type=name_type,
                            name_value=name_value,
                            name_abbrev=name_abbrev,
                            reported_by=reportedBy,
                            date_reported=dateReported,
                            recurrence_index=recurrenceIndex,
                            adherence=adherence,
                            nonadherence_reason=nonadherenceReason)

      return adherenceitem_obj
    except Exception, e:
      raise ValueError("problem processing medicationscheduleitem report " + str(e))
예제 #12
0
    def post_data(self,
                  name=None,
                  name_type=None,
                  name_value=None,
                  name_abbrev=None,
                  reportedBy=None,
                  dateReported=None,
                  recurrenceIndex=None,
                  adherence=None,
                  nonadherenceReason=None):
        """
    SZ: More error checking needs to be performed in this method
    """

        try:
            """
      Elliot: 3/4 changed parse_utc_date to parse_date
      """
            if dateReported:
                dateReported = iso8601.parse_date(dateReported)

            adherenceitem_obj = AdherenceItem.objects.create(
                name=name,
                name_type=name_type,
                name_value=name_value,
                name_abbrev=name_abbrev,
                reported_by=reportedBy,
                date_reported=dateReported,
                recurrence_index=recurrenceIndex,
                adherence=adherence,
                nonadherence_reason=nonadherenceReason)

            return adherenceitem_obj
        except Exception, e:
            raise ValueError(
                "problem processing medicationscheduleitem report " + str(e))
예제 #13
0
  def post_data(self, orderType=None,
											orderedBy=None,
											dateTimeOrdered=None,
											dateTimeExpires=None,
											indication=None,
                      name=None,
                      name_type=None,
                      name_value=None,
                      name_abbrev=None,
                      form=None,
                      form_type=None,
                      form_value=None,
                      form_abbrev=None,
                      activeIngredient_name=None,
                      activeIngredient_name_type=None,
                      activeIngredient_name_value=None,
                      activeIngredient_name_abbrev=None,
                      dose_unit=None,
                      dose_textvalue=None,
                      dose_value=None,
                      dose_unit_type=None, 
                      dose_unit_value=None,
                      dose_unit_abbrev=None,
                      route=None,
                      route_type=None,
                      route_value=None,
                      route_abbrev=None,
                      activeIngredient_strength_value=None,
                      activeIngredient_strength_textvalue=None,
                      activeIngredient_strength_unit=None,
                      activeIngredient_strength_unit_type=None,
                      activeIngredient_strength_unit_value=None,
                      activeIngredient_strength_unit_abbrev=None,
                      frequency=None,
                      frequency_type=None,
                      frequency_value=None,
                      frequency_abbrev=None,
                      amountOrdered_unit=None,
                      amountOrdered_textvalue=None,
                      amountOrdered_value=None,
                      amountOrdered_unit_type=None, 
                      amountOrdered_unit_value=None,
                      amountOrdered_unit_abbrev=None,
											refills=None,
											substitutionPermitted=None,
											instructions=None,
											dateTimeStarted=None,
											dateTimeStopped=None,
											reasonStopped=None):

    """
    SZ: More error checking needs to be performed in this method
    """
    try:
      if dateTimeStarted:
        """
        Elliot: 3/4 changed parse_utc_date to parse_date as it more correctly maps to the XML component.
        """
        dateTimeStarted = iso8601.parse_date(dateTimeStarted)

      if dateTimeStopped:
        dateTimeStopped = iso8601.parse_date(dateTimeStopped)

      if dateTimeOrdered:
        dateTimeOrdered = iso8601.parse_date(dateTimeOrdered)
      if dateTimeExpires:
        dateTimeExpires = iso8601.parse_date(dateTimeExpires)

      medication_obj = Medication.objects.create(   datetime_started=dateTimeStarted,
  																				          datetime_stopped=dateTimeStopped,
                                                    order_type=orderType,
                                                    ordered_by=orderedBy,
                                                    datetime_ordered=dateTimeOrdered,
	                                                  datetime_expires=dateTimeExpires,
	                                                  indication=indication,
                                                    name=name,
                                                    name_type=name_type,
                                                    name_value=name_value,
                                                    name_abbrev=name_abbrev,
                                                    activeingredient_name=activeIngredient_name,
                                                    activeingredient_name_type=activeIngredient_name_type,
                                                    activeingredient_name_value=activeIngredient_name_value,
                                                    activeingredient_name_abbrev=activeIngredient_name_abbrev,
                                                    form=form,
                                                    form_type=form_type,
                                                    form_value=form_value,
                                                    form_abbrev=form_abbrev,
                                                    dose_textvalue=dose_textvalue,
                                                    dose_value=dose_value,
                                                    dose_unit=dose_unit,
                                                    dose_unit_type=dose_unit_type,
                                                    dose_unit_value=dose_unit_value,
                                                    dose_unit_abbrev=dose_unit_abbrev,
                                                    route=route,
                                                    route_type=route_type,
                                                    route_value=route_value,
                                                    route_abbrev=route_abbrev,
                                                    activeingredient_strength_textvalue=activeIngredient_strength_textvalue,
                                                    activeingredient_strength_value=activeIngredient_strength_value,
                                                    activeingredient_strength_unit=activeIngredient_strength_unit,
                                                    activeingredient_strength_unit_type=activeIngredient_strength_unit_type,
                                                    activeingredient_strength_unit_value=activeIngredient_strength_unit_value,
                                                    activeingredient_strength_unit_abbrev=activeIngredient_strength_unit_abbrev,
                                                    frequency=frequency,
                                                    frequency_type=frequency_type,
                                                    frequency_value=frequency_value,
                                                    frequency_abbrev=frequency_abbrev,
                                                    amount_ordered_unit=amountOrdered_unit,
                                                    amount_ordered_textvalue=amountOrdered_textvalue,
                                                    amount_ordered_value=amountOrdered_value,
                                                    amount_ordered_unit_type=amountOrdered_unit_type,
                                                    amount_ordered_unit_value=amountOrdered_unit_value,
                                                    amount_ordered_unit_abbrev=amountOrdered_unit_abbrev,
	                                                  refills=refills,
	                                                  substitution_permitted=substitutionPermitted,
	                                                  instructions=instructions,
	                                                  reason_stopped=reasonStopped)

      return medication_obj
    except Exception, e:
      raise ValueError("problem processing medication report " + str(e))
  def post_data(self, name=None,
                      name_type=None,
                      name_value=None,
                      name_abbrev=None,
                      scheduledBy=None,
                      dateScheduled=None,
                      dateStart=None,
                      dateEnd=None,
                      recurrenceRule_frequency=None,
                      recurrenceRule_frequency_type=None,
                      recurrenceRule_frequency_value=None,
                      recurrenceRule_frequency_abbrev=None,
                      recurrenceRule_interval=None,
                      recurrenceRule_interval_type=None,
                      recurrenceRule_interval_value=None,
                      recurrenceRule_interval_abbrev=None,
                      recurrenceRule_dateUntil=None,
                      recurrenceRule_count=None,
                      dose_unit=None,
                      dose_textvalue=None,
                      dose_value=None,
                      dose_unit_type=None, 
                      dose_unit_value=None,
                      dose_unit_abbrev=None,
											instructions=None):

    """
    SZ: More error checking needs to be performed in this method
    """
    print "top of post_data"
    try:
      if dateScheduled:
        """
        Elliot: 3/4 changed parse_utc_date to parse_date to handle XML:datetime
        """
        dateScheduled = iso8601.parse_date(dateScheduled)

      if dateStart:
        """
        Elliot: 3/4 changed parse_utc_date to parse_date to handle XML:datetime
        """
        dateStart = iso8601.parse_date(dateStart)

      if dateEnd:
        """
        Elliot: 3/4 changed parse_utc_date to parse_date to handle XML:datetime
        """
        dateEnd = iso8601.parse_date(dateEnd)

      if recurrenceRule_dateUntil:
        """
        Elliot: 3/4 changed parse_utc_date to parse_date to handle XML:datetime
        """
        recurrenceRule_dateUntil = iso8601.parse_date(recurrenceRule_dateUntil)

      print "post_data about to create object"

      medicationscheduleitem_obj = MedicationScheduleItem.objects.create(   
                      name=name,
                      name_type=name_type,
                      name_value=name_value,
                      name_abbrev=name_abbrev,
                      scheduled_by=scheduledBy,
											date_scheduled=dateScheduled,
                      date_start=dateStart,
                      date_end=dateEnd,
                      recurrencerule_frequency=recurrenceRule_frequency,
                      recurrencerule_frequency_type=recurrenceRule_frequency_type,
                      recurrencerule_frequency_value=recurrenceRule_frequency_value,
                      recurrencerule_frequency_abbrev=recurrenceRule_frequency_abbrev,
                      recurrencerule_interval=recurrenceRule_interval,
                      recurrencerule_interval_type=recurrenceRule_interval_type,
                      recurrencerule_interval_value=recurrenceRule_interval_value,
                      recurrencerule_interval_abbrev=recurrenceRule_interval_abbrev,
                      recurrencerule_dateuntil=recurrenceRule_dateUntil,
                      recurrencerule_count=recurrenceRule_count,
                      dose_unit=dose_unit,
                      dose_textvalue=dose_textvalue,
                      dose_value=dose_value,
                      dose_unit_type=dose_unit_type, 
                      dose_unit_value=dose_unit_value,
                      dose_unit_abbrev=dose_unit_abbrev,
											instructions=instructions)

      print "after schedule item create"
      return medicationscheduleitem_obj
    except Exception, e:
      print "Exception: " + str(e)
      raise ValueError("problem processing medicationscheduleitem report " + str(e))
예제 #15
0
  def post_data(self, name=None,
                      name_type=None,
                      name_value=None,
                      name_abbrev=None,
                      scheduledBy=None,
                      dateScheduled=None,
                      dateStart=None,
                      dateEnd=None,
                      recurrenceRule_frequency=None,
                      recurrenceRule_frequency_type=None,
                      recurrenceRule_frequency_value=None,
                      recurrenceRule_frequency_abbrev=None,
                      recurrenceRule_interval=None,
                      recurrenceRule_interval_type=None,
                      recurrenceRule_interval_value=None,
                      recurrenceRule_interval_abbrev=None,
                      recurrenceRule_dateUntil=None,
                      recurrenceRule_count=None,
											instructions=None):

    """
    SZ: More error checking needs to be performed in this method
    """

    try:
      if dateScheduled:
        """
        Elliot: 3/4 changed parse_utc_date to parse_date to handle XML:datetime
        """
        dateScheduled = iso8601.parse_date(dateScheduled)

      if dateStart:
        """
        Elliot: 3/4 changed parse_utc_date to parse_date to handle XML:datetime
        """
        dateStart = iso8601.parse_date(dateStart)

      if dateEnd:
        """
        Elliot: 3/4 changed parse_utc_date to parse_date to handle XML:datetime
        """
        dateEnd = iso8601.parse_date(dateEnd)

      if recurrenceRule_dateUntil:
        """
        Elliot: 3/4 changed parse_utc_date to parse_date to handle XML:datetime
        """
        recurrenceRule_dateUntil = iso8601.parse_date(recurrenceRule_dateUntil)

      equipmentscheduleitem_obj = EquipmentScheduleItem.objects.create(   
                      name=name,
                      name_type=name_type,
                      name_value=name_value,
                      name_abbrev=name_abbrev,
                      scheduled_by=scheduledBy,
											date_scheduled=dateScheduled,
                      date_start=dateStart,
                      date_end=dateEnd,
                      recurrencerule_frequency=recurrenceRule_frequency,
                      recurrencerule_frequency_type=recurrenceRule_frequency_type,
                      recurrencerule_frequency_value=recurrenceRule_frequency_value,
                      recurrencerule_frequency_abbrev=recurrenceRule_frequency_abbrev,
                      recurrencerule_interval=recurrenceRule_interval,
                      recurrencerule_interval_type=recurrenceRule_interval_type,
                      recurrencerule_interval_value=recurrenceRule_interval_value,
                      recurrencerule_interval_abbrev=recurrenceRule_interval_abbrev,
                      recurrencerule_dateuntil=recurrenceRule_dateUntil,
                      recurrencerule_count=recurrenceRule_count,
											instructions=instructions)

      return equipmentscheduleitem_obj
    except Exception, e:
      print "Error: " + str(e)
      raise ValueError("problem processing equipmentscheduleitem report " + str(e))
  def post_data(self, name=None,
                      name_type=None,
                      name_value=None,
                      name_abbrev=None,
                      reportedBy=None,
                      dateReported=None,
                      dateAdministered=None,
                      amountAdministered_unit=None,
                      amountAdministered_textvalue=None,
                      amountAdministered_value=None,
                      amountAdministered_unit_type=None, 
                      amountAdministered_unit_value=None,
                      amountAdministered_unit_abbrev=None,
                      amountRemaining_unit=None,
                      amountRemaining_textvalue=None,
                      amountRemaining_value=None,
                      amountRemaining_unit_type=None, 
                      amountRemaining_unit_value=None,
                      amountRemaining_unit_abbrev=None):


    """
    SZ: More error checking needs to be performed in this method
    """

    try:
      if dateReported:
        """
        Elliot: 3/4 changed parse_utc_date to parse_date to handle XML:datetime
        """
        dateReported = iso8601.parse_date(dateReported)

      if dateAdministered:
        """
        Elliot: 3/4 changed parse_utc_date to parse_date to handle XML:datetime
        """
        dateAdministered = iso8601.parse_date(dateAdministered)


      medicationadministration_obj = MedicationAdministration.objects.create(   
                      name=name,
                      name_type=name_type,
                      name_value=name_value,
                      name_abbrev=name_abbrev,
                      reported_by=reportedBy,
                      date_reported=dateReported,
                      date_administered=dateAdministered,
                      amountadministered_unit=amountAdministered_unit,
                      amountadministered_textvalue=amountAdministered_textvalue,
                      amountadministered_value=amountAdministered_value,
                      amountadministered_unit_type=amountAdministered_unit_type, 
                      amountadministered_unit_value=amountAdministered_unit_value,
                      amountadministered_unit_abbrev=amountAdministered_unit_abbrev,
                      amountremaining_unit=amountRemaining_unit,
                      amountremaining_textvalue=amountRemaining_textvalue,
                      amountremaining_value=amountRemaining_value,
                      amountremaining_unit_type=amountRemaining_unit_type, 
                      amountremaining_unit_value=amountRemaining_unit_value,
                      amountremaining_unit_abbrev=amountRemaining_unit_abbrev)


      return medicationadministration_obj
    except Exception, e:
      raise ValueError("problem processing medicationadministration report " + str(e))
예제 #17
0
  def post_data(self, name=None,
                      name_type=None,
                      name_value=None,
                      name_abbrev=None,
                      reportedBy=None,
                      dateReported=None,
                      dateAdministered=None,
                      amountAdministered_unit=None,
                      amountAdministered_textvalue=None,
                      amountAdministered_value=None,
                      amountAdministered_unit_type=None, 
                      amountAdministered_unit_value=None,
                      amountAdministered_unit_abbrev=None,
                      amountRemaining_unit=None,
                      amountRemaining_textvalue=None,
                      amountRemaining_value=None,
                      amountRemaining_unit_type=None, 
                      amountRemaining_unit_value=None,
                      amountRemaining_unit_abbrev=None):


    """
    SZ: More error checking needs to be performed in this method
    """

    try:
      if dateReported:
        """
        Elliot: 3/4 changed parse_utc_date to parse_date to handle XML:datetime
        """
        dateReported = iso8601.parse_date(dateReported)

      if dateAdministered:
        """
        Elliot: 3/4 changed parse_utc_date to parse_date to handle XML:datetime
        """
        dateAdministered = iso8601.parse_date(dateAdministered)


      medicationadministration_obj = MedicationAdministration.objects.create(   
                      name=name,
                      name_type=name_type,
                      name_value=name_value,
                      name_abbrev=name_abbrev,
                      reported_by=reportedBy,
                      date_reported=dateReported,
                      date_administered=dateAdministered,
                      amountadministered_unit=amountAdministered_unit,
                      amountadministered_textvalue=amountAdministered_textvalue,
                      amountadministered_value=amountAdministered_value,
                      amountadministered_unit_type=amountAdministered_unit_type, 
                      amountadministered_unit_value=amountAdministered_unit_value,
                      amountadministered_unit_abbrev=amountAdministered_unit_abbrev,
                      amountremaining_unit=amountRemaining_unit,
                      amountremaining_textvalue=amountRemaining_textvalue,
                      amountremaining_value=amountRemaining_value,
                      amountremaining_unit_type=amountRemaining_unit_type, 
                      amountremaining_unit_value=amountRemaining_unit_value,
                      amountremaining_unit_abbrev=amountRemaining_unit_abbrev)


      return medicationadministration_obj
    except Exception, e:
      raise ValueError("problem processing medicationadministration report " + str(e))
예제 #18
0
    def post_data(self,
                  orderType=None,
                  orderedBy=None,
                  dateTimeOrdered=None,
                  dateTimeExpires=None,
                  indication=None,
                  name=None,
                  name_type=None,
                  name_value=None,
                  name_abbrev=None,
                  form=None,
                  form_type=None,
                  form_value=None,
                  form_abbrev=None,
                  activeIngredient_name=None,
                  activeIngredient_name_type=None,
                  activeIngredient_name_value=None,
                  activeIngredient_name_abbrev=None,
                  dose_unit=None,
                  dose_textvalue=None,
                  dose_value=None,
                  dose_unit_type=None,
                  dose_unit_value=None,
                  dose_unit_abbrev=None,
                  route=None,
                  route_type=None,
                  route_value=None,
                  route_abbrev=None,
                  activeIngredient_strength_value=None,
                  activeIngredient_strength_textvalue=None,
                  activeIngredient_strength_unit=None,
                  activeIngredient_strength_unit_type=None,
                  activeIngredient_strength_unit_value=None,
                  activeIngredient_strength_unit_abbrev=None,
                  frequency=None,
                  frequency_type=None,
                  frequency_value=None,
                  frequency_abbrev=None,
                  amountOrdered_unit=None,
                  amountOrdered_textvalue=None,
                  amountOrdered_value=None,
                  amountOrdered_unit_type=None,
                  amountOrdered_unit_value=None,
                  amountOrdered_unit_abbrev=None,
                  refills=None,
                  substitutionPermitted=None,
                  instructions=None,
                  dateTimeStarted=None,
                  dateTimeStopped=None,
                  reasonStopped=None):
        """
    SZ: More error checking needs to be performed in this method
    """
        try:
            if dateTimeStarted:
                """
        Elliot: 3/4 changed parse_utc_date to parse_date as it more correctly maps to the XML component.
        """
                dateTimeStarted = iso8601.parse_date(dateTimeStarted)

            if dateTimeStopped:
                dateTimeStopped = iso8601.parse_date(dateTimeStopped)

            if dateTimeOrdered:
                dateTimeOrdered = iso8601.parse_date(dateTimeOrdered)
            if dateTimeExpires:
                dateTimeExpires = iso8601.parse_date(dateTimeExpires)

            medication_obj = Medication.objects.create(
                datetime_started=dateTimeStarted,
                datetime_stopped=dateTimeStopped,
                order_type=orderType,
                ordered_by=orderedBy,
                datetime_ordered=dateTimeOrdered,
                datetime_expires=dateTimeExpires,
                indication=indication,
                name=name,
                name_type=name_type,
                name_value=name_value,
                name_abbrev=name_abbrev,
                activeingredient_name=activeIngredient_name,
                activeingredient_name_type=activeIngredient_name_type,
                activeingredient_name_value=activeIngredient_name_value,
                activeingredient_name_abbrev=activeIngredient_name_abbrev,
                form=form,
                form_type=form_type,
                form_value=form_value,
                form_abbrev=form_abbrev,
                dose_textvalue=dose_textvalue,
                dose_value=dose_value,
                dose_unit=dose_unit,
                dose_unit_type=dose_unit_type,
                dose_unit_value=dose_unit_value,
                dose_unit_abbrev=dose_unit_abbrev,
                route=route,
                route_type=route_type,
                route_value=route_value,
                route_abbrev=route_abbrev,
                activeingredient_strength_textvalue=
                activeIngredient_strength_textvalue,
                activeingredient_strength_value=activeIngredient_strength_value,
                activeingredient_strength_unit=activeIngredient_strength_unit,
                activeingredient_strength_unit_type=
                activeIngredient_strength_unit_type,
                activeingredient_strength_unit_value=
                activeIngredient_strength_unit_value,
                activeingredient_strength_unit_abbrev=
                activeIngredient_strength_unit_abbrev,
                frequency=frequency,
                frequency_type=frequency_type,
                frequency_value=frequency_value,
                frequency_abbrev=frequency_abbrev,
                amount_ordered_unit=amountOrdered_unit,
                amount_ordered_textvalue=amountOrdered_textvalue,
                amount_ordered_value=amountOrdered_value,
                amount_ordered_unit_type=amountOrdered_unit_type,
                amount_ordered_unit_value=amountOrdered_unit_value,
                amount_ordered_unit_abbrev=amountOrdered_unit_abbrev,
                refills=refills,
                substitution_permitted=substitutionPermitted,
                instructions=instructions,
                reason_stopped=reasonStopped)

            return medication_obj
        except Exception, e:
            raise ValueError("problem processing medication report " + str(e))