API v2 of Last mile

House hold

House hold List

GET /api-last-smile/v1/fociHouseHold/list

get list of house hold

Query Parameters
  • village_code (int) – code of village

Respone as json:

{
  "code": 200,
  "message": "success",
  "data": [
    {
      "Rec_ID": 119,
      "Month": "7",
      "Year": "2021",
      "Code_Vill_T": "1504060300",
      "HouseNumber": 1,
      "HouseHolder": "ធី",
      "Phone": "010898989",
      "TotalMember": 2,
      "LLIN": 3,
      "LLINLack": -2,
      "LLIHN": 1,
      "LLIHNLack": 0,
      "TotalForestEntry": 1,
      "Lat": 11.5923671,
      "Long": 104.8897794,
      "HasMemberAtHome": null,
      "InitUser": null,
      "IsMobileEntry": null,
      "TDA1": null,
      "TDA2": null,
      "IPT": [],
      "AFS": []
    }
  ]
}
Object
  • HasMemberAtHome (string) – Yes/No.

  • TDA1 (string) – Date of TDA 1.

  • TDA2 (string) – Date of TDA 2.

  • IPT (array) – Date of IPT (Array).

  • AFS (array) – Date of AFS (Array).

House hold detail

GET /api-last-smile/v1/fociHouseHold/detail

get detail of house hold

Query Parameters
  • house_hold_id (int) – id (primary key) house hold.

Respone as json:

{
  "code": 200,
  "message": "success",
  "data": {
      "house": {
          "Rec_ID": 21,
          "Month": "4",
          "Year": "2021",
          "Code_Vill_T": "0504033301",
          "HouseNumber": 1,
          "HouseHolder": "Dary",
          "Phone": "069859540",
          "TotalMember": 2,
          "LLIN": 2,
          "LLINLack": -1,
          "LLIHN": 1,
          "LLIHNLack": 0,
          "TotalForestEntry": 1,
          "Lat": 11.8050141,
          "Long": 104.1685751,
          "HasMemberAtHome": null,
          "InitUser": null,
          "IsMobileEntry": null,
          "TDA1": null,
          "TDA2": null,
          "IPT": []
      },
      "members": [
          {
              "Rec_ID": 40,
              "Name": "Dara",
              "Age": 22,
              "Sex": "M",
              "ForestEntry": "Yes",
              "TDA": "Yes",
              "IPT": "Yes",
              "HouseHoldID": 21
          },
          {
              "Rec_ID": 41,
              "Name": "Daro",
              "Age": 43,
              "Sex": "F",
              "ForestEntry": "No",
              "TDA": null,
              "IPT": null,
              "HouseHoldID": 21
          }
      ]
  }
}

Insert/Update house hold

POST /api-last-smile/v1/fociHouseHold/update

Insert/Update house hold

Parse as json:

{
  "house":{
    "Rec_ID": null,
    "Code_Vill_T": "0109050901",
    "HouseNumber": "1",
    "HouseHolder": "test",
    "Phone": "013346789",
    "TotalMember": 8,
    "LLIN": 1,
    "LLINLack": -1,
    "LLIHN": 1,
    "LLIHNLack": -2,
    "TotalForestEntry": 0,
    "Month": "01",
    "Year": "2021",
    "HasMemberAtHome": "Yes",
    "Lat": 122.255,
    "Long": 234.555
  },
  "member": [
    {
      "Rec_ID": null,
      "Name": "ta",
      "Age": "34",
      "Sex": "M",
      "ForestEntry": "No",
      "TDA": "",
      "IPT": "",
      "HouseHoldID": 1
    },
    {
      "Rec_ID": null,
      "Name": "ty",
      "Age": "40",
      "Sex": "F",
      "ForestEntry": "Yes",
      "TDA": "",
      "IPT": "",
      "HouseHoldID": 1
    },
    {
      "Rec_ID": null,
      "Name": "tt",
      "Age": 45,
      "Sex": "M",
      "ForestEntry": "Yes",
      "TDA": "",
      "IPT": "",
      "HouseHoldID": 1
    }
  ]
}
Object
  • HasMemberAtHome (string) – Yes/No.

  • TDA (string) – Yes/No.

  • IPT (string) – Yes/No.

  • ForestEntry (string) – Yes/No.

Note

If Rec_ID is null then it will insert new.

if Rec_ID is not null then it will update.

If member of house hold with Age between 15 and 49 and Sex = M then TDA = Yes

If member of house hold with Age between 15 and 49 and ForestEntry = Yes then IPT = Yes

TDA

TDA form

GET /api-last-smile/v1/TDA/form

Get form of TDA

Query Parameters
  • house_hold_id (int) – id (primary key) house hold.

  • type (int) – 1/2.

Respone as json:

{
  "code": 200,
  "message": "success",
  "data": {
    "TDA": [
        {
          "TDADate": "2021-07-19",
          "HouseHoldID": 216,
          "HouseMemberID": 792,
          "Name": "ភៀង សុង",
          "Age": 35,
          "Sex": "M",
          "DoNotUse": "No",
          "Reject": "No",
          "Absent": "Yes",
          "SideEffect": null,
          "RejectReason": null,
          "Type": 1,
          "Date": null,
          "IsTDA": 1
        },
        {
          "TDADate": "2021-07-19",
          "HouseHoldID": 216,
          "HouseMemberID": 794,
          "Name": "សុង វិច",
          "Age": 15,
          "Sex": "M",
          "DoNotUse": "No",
          "Reject": "No",
          "Absent": "Yes",
          "SideEffect": null,
          "RejectReason": null,
          "Type": 1,
          "Date": null,
          "IsTDA": 1
        }
    ]
  }
}
Object
  • DoNotUse (string) – Yes/No.

  • Reject (string) – Yes/No.

  • Absent (string) – Yes/No.

Insert/Update TDA

POST /api-last-smile/v1/TDA/update

Insert/update TDA

Parse as json:

{
  "TDA" : [
    {
        "TDADate" : "2021-07-07",
        "DoNotUse": "Yes",
        "Reject": "",
        "Absent": "",
        "Type": "1",
        "Date": "2021-18-01",
        "SideEffect": "headache",
        "RejectReason": "lazy",
        "HouseHoldID": 216,
        "HouseMemberID": 794
    },
    {
        "TDADate" : "2021-07-07",
        "DoNotUse": "Yes",
        "Reject": "",
        "Absent": "",
        "Type": "1",
        "Date": "",
        "SideEffect": "headache",
        "RejectReason": "lazy",
        "HouseHoldID": 216,
        "HouseMemberID": 794
    }
  ]
}

Note

TDA1 and TDA2 must be 28 days apart.

Must complete TDA1/TDA2 before do IPT.

IPT and TDA1 must be 14 days apart.

IPT and TDA2 must be 28 days apart.

IPT

IPT form

GET /api-last-smile/v1/IPT/form

Get form of IPT

Query Parameters
  • house_hold_id (int) – id (primary key) house hold.

  • month (string) – 01,02,…,12.

  • year (string) – 2021,2022,…

Respone as json:

{
  "code": 200,
  "message": "success",
  "data": {
    "IPT": [
      {
          "HouseMemberID": 792,
          "Month": null,
          "Year": null,
          "Name": "ភៀង សុង",
          "Age": 35,
          "Sex": "M",
          "IPTDate": null,
          "DoNotUse": null,
          "Reject": null,
          "Date": null,
          "HouseHoldID": 216,
          "NotEnterForest": null,
          "RefuseReason": null,
          "Absent": null,
          "IsIPT": 1
      }
    ]
  }
}
Object
  • NotEnterForest (string) – Yes/No.

  • DoNotUse (string) – Yes/No.

  • Reject (string) – Yes/No.

  • Absent (string) – Yes/No.

Insert/Update IPT

POST /api-last-smile/v1/IPT/update

Insert/update IPT

Parse as json:

{
  "IPT": [
      {
          "HouseMemberID": 479,
          "Month": "08",
          "Year": 2021,
          "IPTDate": "2021-07-07",
          "DoNotUse": "",
          "Reject": "",
          "Date": "",
          "NotEnterForest": "",
          "Absent": "",
          "RefuseReason": "",
          "HouseHoldID": 82
      }
  ]
}

AFS

AFS form

GET /api-last-smile/v1/AFS/form

Get form of AFS

Query Parameters
  • house_hold_id (int) – id (primary key) house hold.

  • afs_date (string) – Date of AFS, YYYY-MM-DD, e.g: 2021-11-30.

Respone as json:

{
  "code": 200,
  "message": "success",
  "data": {
    "AFS": [
      {
          "HouseMemberID": 479,
          "Name": "Sophy",
          "Age": 36,
          "Sex": "F",
          "AFSDate": null,
          "W1": null,
          "W2": null,
          "W3": null,
          "W4": null,
          "W1Specie": null,
          "W2Specie": null,
          "W3Specie": null,
          "W4Specie": null,
          "HouseHoldID": 82
      },
      {
          "HouseMemberID": 480,
          "Name": "Bopha",
          "Age": 38,
          "Sex": "M",
          "AFSDate": null,
          "W1": null,
          "W2": null,
          "W3": null,
          "W4": null,
          "W1Specie": null,
          "W2Specie": null,
          "W3Specie": null,
          "W4Specie": null,
          "HouseHoldID": 82
      }
    ]
  }
}
Object
  • W1/W2/W3/W4 (string) – Yes/No/N/A.

  • W1Specie/W2Specie/W3Specie/W4Specie (string) – F/V/M/N.

Insert/Update AFS

POST /api-last-smile/v1/AFS/update

Insert/update AFS

Parse as json:

{
  "AFS": [
    {
        "HouseMemberID": 479,
        "AFSDate": "2021-07-07",
        "W1": "",
        "W2": "",
        "W3": "",
        "W4": "",
        "W1Specie": null,
        "W2Specie": null,
        "W3Specie": null,
        "W4Specie": null,
        "HouseHoldID": 82
    },
    {
        "HouseMemberID": 480,
        "AFSDate": "2021-07-07",
        "W1": "",
        "W2": "",
        "W3": "",
        "W4": "",
        "W1Specie": "Pv",
        "W2Specie": null,
        "W3Specie": null,
        "W4Specie": null,
        "HouseHoldID": 82
    }
  ]
}