Medications module

Medications List

Medications list view
Medications List
API URL
  /api/patients/{patientId}/medications
GET data
  {
    dateCreated:1460741442000
    doseAmount:"20mg"
    name:"Avelox"
    source:"ethercis"
    sourceId:"dd51f0f9-8ab0-40f6-969f-87d4af5edcd8"
  }
Component structure
  //component template
  let templateMedicationsList = require('./medications-list.html');

  //controller init
  class MedicationsListController {
    constructor($scope, $state, $stateParams, $ngRedux, medicationsActions, serviceRequests, usSpinnerService) {
    }

    //component init
    const MedicationsListComponent = {
      template: templateMedicationsList,
      controller: MedicationsListController
    };

  //inject services/modules to controller
  MedicationsListController.$inject = ['$scope', '$state', '$stateParams', '$ngRedux', 'medicationsActions', 'serviceRequests', 'usSpinnerService'];
  //es6 export for component
  export default MedicationsListComponent;

Medications Detail

Medications Detail
Medications Detail
API URL
  /api/patients/{patientId}/medications/{sourceId}
GET data
  {
    author:"c4h_ripple_osi"
    dateCreated:1446482102197
    doseAmount:"1000mg"
    doseDirections:"Orally"
    doseTiming:"Orally Daily"
    medicationCode:"DefaultCode"
    medicationTerminology:"SNOMED-CT"
    name:"Amoxicillin"
    route:"RouteValue"
    source:"Marand"
    sourceId:"ba75d477-5ad4-4ad6-b126-94bd2324c101"
    startDate:1448629200000
    startTime:46800000
  }
Component structure
  //component template
  let templateMedicationsDetail= require('./medications-detail.html');

  //controller init
  class MedicationsDetailController {
    constructor($scope, $state, $stateParams, $ngRedux, medicationsActions, usSpinnerService, serviceRequests) {
    }

    //component init
    const MedicationsDetailComponent = {
      template: templateMedicationsDetail,
      controller: MedicationsDetailController
    };

  //inject services/modules to controller
  MedicationsDetailController.$inject = ['$scope', '$state', '$stateParams', '$ngRedux', 'medicationsActions', 'usSpinnerService', 'serviceRequests'];
  //es6 export for component
  export default MedicationsDetailComponent;

Medications Create

Medications Create
Medications Prescription
API URL
  /api/patients/{patientId}/medications/{sourceId}
POST data
  {
    doseAmount:"22"
    doseDirections:"qqwweer"
    doseTiming:"33"
    medicationCode:"123456789"
    name:"test med"
    route:"PN Per Nasal"
    sourceId:""
    startDate:"2017-04-07T07:02:47.576Z"
  }
Component structure
  //component template
  let templateMedicationsCreate = require('./medications-create.html');

  //controller init
  class MedicationsCreateController {
    constructor($scope, $state, $stateParams, $ngRedux, medicationsActions, serviceRequests, usSpinnerService) {
    }

    //component init
    const MedicationsCreateComponent = {
      template: templateMedicationsCreate,
      controller: MedicationsCreateController
    };

  //inject services/modules to controller
  MedicationsCreateController.$inject = ['$scope', '$state', '$stateParams', '$ngRedux', 'medicationsActions', 'serviceRequests', 'usSpinnerService'];
  //es6 export for component
  export default MedicationsCreateComponent;

Medications Edit
Medications Edit
API URL
  /api/patients/{patientId}/medications/{sourceId}
PUT data
  {
    author:"c4h_ripple_osi"
    dateCreated:"2015-11-02T16:35:02.197Z"
    doseAmount:"1000mg"
    doseDirections:"Orally"
    doseTiming:"Orally Daily"
    medicationCode:"DefaultCode"
    medicationTerminology:"SNOMED-CT"
    name:"Amoxicillin t"
    route:"RouteValue"
    sourceId:""
    startDate:"2015-11-27T13:00:00.000Z"
    startTime:"1970-01-01T13:00:00.000Z"
  }