API v3 of Last mile
House hold
Insert/Update
- 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, "CompleteBy": "Vicheka Nar", "Position": "Village manager", "CompleteDate": "2022-07-07" }, "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/v3/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": null, "HouseHoldID": 216, "HouseMemberID": 792, "Name": "ភៀង សុង", "Age": 35, "Sex": "M", "DoNotUse": null, "SideEffect": null, "NotSick": null, "RejectOtherReason": null, "Absent": null, "Type": null, "Date": null, "IsTDA": 1 }, { "TDADate": "2021-07-07", "HouseHoldID": 216, "HouseMemberID": 794, "Name": "សុង វិច", "Age": 15, "Sex": "M", "DoNotUse": "No", "SideEffect": null, "NotSick": null, "RejectOtherReason": "Affraid", "Absent": "No", "Type": 1, "Date": "2021-18-01", "IsTDA": 1 }, { "TDADate": "2021-07-07", "HouseHoldID": 216, "HouseMemberID": 794, "Name": "សុង វិច", "Age": 15, "Sex": "M", "DoNotUse": "No", "SideEffect": "Yes", "NotSick": "Yes", "RejectOtherReason": "Fear", "Absent": "No", "Type": 1, "Date": "2021-18-01", "IsTDA": 1 }, { "TDADate": "2021-07-07", "HouseHoldID": 216, "HouseMemberID": 794, "Name": "សុង វិច", "Age": 15, "Sex": "M", "DoNotUse": "No", "SideEffect": "Yes", "NotSick": "", "RejectOtherReason": "Affraid", "Absent": "No", "Type": 1, "Date": "2021-18-01", "IsTDA": 1 } ] } }
- Object
DoNotUse (string) – Yes/No.
SideEffect (string) – Yes/No.
NotSick (string) – Yes/No.
RejectOtherReason (string) – any string
Absent (string) – Yes/No.
Insert/Update TDA
- POST /api-last-smile/v3/TDA/update
Insert/update TDA
Parse as json:
{ "TDA" : [ { "TDADate" : "2021-07-07", "DoNotUse": "No", "Absent": "No", "Type": "1", "Date": "2021-18-01", "SideEffect": "Yes", "NotSick": "Yes", "RejectOtherReason": "Fear", "HouseHoldID": 216, "HouseMemberID": 794 }, { "TDADate" : "2021-07-07", "DoNotUse": "No", "Absent": "No", "Type": "1", "Date": "2021-18-01", "SideEffect": "Yes", "NotSick": "", "RejectOtherReason": "Affraid", "HouseHoldID": 217, "HouseMemberID": 794 } ] }
- Object
DoNotUse (string) – Yes/No.
SideEffect (string) – Yes/No.
NotSick (string) – Yes/No.
RejectOtherReason (string) – any string
Absent (string) – Yes/No.
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.
TDA summary
- GET /api-last-smile/v3/TDA/summary
Get TDA summary
- Query Parameters
house_hold_id (int) – id (primary key) house hold.
Response as json:
{ "code": 200, "message": "success", "data": [ { "TotalTDA": 0, "TDA1": 0, "SideEffectTDA1": 0, "NotSickTDA1": 0, "OtherTDA1": 0, "DoNotUseTDA1": 0, "AbsentTDA1": 0, "TDA2": 0, "SideEffectTDA2": 0, "NotSickTDA2": 0, "OtherTDA2": 0, "DoNotUseTDA2": 0, "AbsentTDA2": 0 } ] }
IPT
IPT form
- GET /api-last-smile/v3/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, "Date": null, "HouseHoldID": 216, "NotEnterForest": null, "SideEffect": null, "NotSick": null, "RefuseOtherReason": null, "Absent": null }, { "HouseMemberID": 794, "Month": null, "Year": null, "Name": "សុង វិច", "Age": 15, "Sex": "M", "IPTDate": null, "DoNotUse": null, "Date": null, "HouseHoldID": 216, "NotEnterForest": null, "SideEffect": null, "NotSick": null, "RefuseOtherReason": null, "Absent": null } ] } }
- Object
NotEnterForest (string) – Yes/No.
DoNotUse (string) – Yes/No.
SideEffect (string) – Yes/No.
NotSick (string) – Yes/No.
RefuseOtherReason (string) – any string
Absent (string) – Yes/No.
Date (date) – date when received IPTf
Insert/Update IPT
- POST /api-last-smile/v3/IPT/update
Insert/update IPT
Parse as json:
{ "IPT": [ { "HouseMemberID": 479, "Month": "08", "Year": 2021, "IPTDate": "2021-07-07", "DoNotUse": "No", "SideEffect": "Yes", "NotSick": "Yes", "RefuseOtherReason": "Afraid", "Date": "", "NotEnterForest": "No", "Absent": "No", "HouseHoldID": 82 }, { "HouseMemberID": 478, "Month": "08", "Year": 2021, "IPTDate": "2021-07-07", "DoNotUse": "No", "SideEffect": "Yes", "NotSick": "", "RefuseOtherReason": "", "Date": "2021-07-07", "NotEnterForest": "No", "Absent": "No", "HouseHoldID": 82 } ] }
- Object
NotEnterForest (string) – Yes/No.
DoNotUse (string) – Yes/No.
SideEffect (string) – Yes/No.
NotSick (string) – Yes/No.
RefuseOtherReason (string) – any string
Absent (string) – Yes/No.
Date (date) – date when received IPTf
AFS
AFS form
- GET /api-last-smile/v3/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, "HouseHoldID": 82 }, { "HouseMemberID": 480, "Name": "Bopha", "Age": 38, "Sex": "M", "AFSDate": null, "W1": null, "W2": null, "W3": null, "W4": null, "HouseHoldID": 82 } ] } }
- Object
W1/W2/W3/W4 (string) –
Yes/No/N/A.
Note
W1/W2/W3/W4 :
Yes– Tested
No– Not Test
N/A– Absent
Insert/Update AFS
- POST /api-last-smile/v3/AFS/update
Insert/update AFS
Parse as json:
{ "AFS": [ { "HouseMemberID": 479, "AFSDate": "2021-07-07", "W1": "Yes", "W2": "No", "W3": "N/A", "W4": "", "HouseHoldID": 82 }, { "HouseMemberID": 480, "AFSDate": "2021-07-07", "W1": "", "W2": "", "W3": "", "W4": "", "HouseHoldID": 82 } ] }
- Object
W1/W2/W3/W4 (string) –
Yes/No/N/A.
Note
W1/W2/W3/W4 :
Yes– Tested
No– Not Test
N/A– Absent