TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaAlihealthDruguseQueryRequest req = new AlibabaAlihealthDruguseQueryRequest();
AlibabaAlihealthDruguseQueryRequest.SafeMedicationReqCommand obj1 = new AlibabaAlihealthDruguseQueryRequest.SafeMedicationReqCommand();
obj1.setOrderId("1838983105989823315");
AlibabaAlihealthDruguseQueryRequest.Patient obj2 = new AlibabaAlihealthDruguseQueryRequest.Patient();
obj2.setGender(1L);
obj2.setWeight(70L);
obj2.setUserId("22287869");
obj2.setAge(55L);
obj2.setHeight(175L);
obj2.setLabels(""PREGNANCY","LACTATION","HYPOHEPATIA","SEVERE_HYPOHEPATIA","SEVERE_RENALINADEQUACY","RENALINADEQUACY"");
obj1.setPatient(obj2);
obj1.setSceneName("prescription");
List<AlibabaAlihealthDruguseQueryRequest.PrescriptionItem> list4 = new ArrayList<AlibabaAlihealthDruguseQueryRequest.PrescriptionItem>();
AlibabaAlihealthDruguseQueryRequest.PrescriptionItem obj5 = new AlibabaAlihealthDruguseQueryRequest.PrescriptionItem();
list4.add(obj5);
AlibabaAlihealthDruguseQueryRequest.Dosage obj7 = new AlibabaAlihealthDruguseQueryRequest.Dosage();
List<AlibabaAlihealthDruguseQueryRequest.DosageItem> list9 = new ArrayList<AlibabaAlihealthDruguseQueryRequest.DosageItem>();
AlibabaAlihealthDruguseQueryRequest.DosageItem obj10 = new AlibabaAlihealthDruguseQueryRequest.DosageItem();
list9.add(obj10);
obj10.setUnit("mg");
obj10.setType("SINGLEDAILYDOSE");
obj10.setValue("10.0");
obj7.setItems(list9);
obj7.setWay("口服");
list6.setDosage(obj7);
AlibabaAlihealthDruguseQueryRequest.BuyAmount obj12 = new AlibabaAlihealthDruguseQueryRequest.BuyAmount();
obj12.setBuyAmount(5L);
obj12.setHistoryDays(10L);
obj12.setHistoryTotalAmount(20L);
list11.setBuyAmount(obj12);
AlibabaAlihealthDruguseQueryRequest.Drug obj14 = new AlibabaAlihealthDruguseQueryRequest.Drug();
obj14.setCommonName("茶碱缓释片");
obj14.setQuantityPerPack(24L);
obj14.setTenantSpuId("22244");
obj14.setProducer("锦州本天药业有限公司");
List<AlibabaAlihealthDruguseQueryRequest.Ingredients> list16 = new ArrayList<AlibabaAlihealthDruguseQueryRequest.Ingredients>();
AlibabaAlihealthDruguseQueryRequest.Ingredients obj17 = new AlibabaAlihealthDruguseQueryRequest.Ingredients();
list16.add(obj17);
obj17.setUnit("mg");
obj17.setQuantity(10L);
obj17.setName("青霉素类广谱β-内酰胺类抗生素");
obj14.setIngredients(list16);
obj14.setSpuId("511281473");
obj14.setUnitOfPerUnit("mg");
obj14.setQuantityPerUnit(10L);
obj14.setApprovalNumber("国药准字H21020004");
obj14.setType("WESTERN_PRESCRIPTION_MEDICINE");
obj14.setNorm("0.1g*24片/盒");
list13.setDrug(obj14);
obj1.setPrescriptionItems(list4);
List<AlibabaAlihealthDruguseQueryRequest.Diag> list19 = new ArrayList<AlibabaAlihealthDruguseQueryRequest.Diag>();
AlibabaAlihealthDruguseQueryRequest.Diag obj20 = new AlibabaAlihealthDruguseQueryRequest.Diag();
list19.add(obj20);
obj20.setCode("F42.900");
obj20.setName("强迫性障碍");
obj1.setDiags(list19);
obj1.setTenantCode("ele");
req.setCommand(obj1);
AlibabaAlihealthDruguseQueryResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaAlihealthDruguseQueryRequest req = new AlibabaAlihealthDruguseQueryRequest();
AlibabaAlihealthDruguseQueryRequest.SafeMedicationReqCommandDomain obj1 = new AlibabaAlihealthDruguseQueryRequest.SafeMedicationReqCommandDomain();
obj1.OrderId = "1838983105989823315";
AlibabaAlihealthDruguseQueryRequest.PatientDomain obj2 = new AlibabaAlihealthDruguseQueryRequest.PatientDomain();
obj2.Gender = 1L;
obj2.Weight = 70L;
obj2.UserId = "22287869";
obj2.Age = 55L;
obj2.Height = 175L;
obj2.Labels = ""PREGNANCY","LACTATION","HYPOHEPATIA","SEVERE_HYPOHEPATIA","SEVERE_RENALINADEQUACY","RENALINADEQUACY"";
obj1.Patient= obj2;
obj1.SceneName = "prescription";
List<AlibabaAlihealthDruguseQueryRequest.PrescriptionItemDomain> list4 = new List<AlibabaAlihealthDruguseQueryRequest.PrescriptionItemDomain>();
AlibabaAlihealthDruguseQueryRequest.PrescriptionItemDomain obj5 = new AlibabaAlihealthDruguseQueryRequest.PrescriptionItemDomain();
list4.Add(obj5);
AlibabaAlihealthDruguseQueryRequest.DosageDomain obj6 = new AlibabaAlihealthDruguseQueryRequest.DosageDomain();
List<AlibabaAlihealthDruguseQueryRequest.DosageItemDomain> list8 = new List<AlibabaAlihealthDruguseQueryRequest.DosageItemDomain>();
AlibabaAlihealthDruguseQueryRequest.DosageItemDomain obj9 = new AlibabaAlihealthDruguseQueryRequest.DosageItemDomain();
list8.Add(obj9);
obj9.Unit = "mg";
obj9.Type = "SINGLEDAILYDOSE";
obj9.Value = "10.0";
obj6.Items= list8;
obj6.Way = "口服";
obj5.Dosage= obj6;
AlibabaAlihealthDruguseQueryRequest.BuyAmountDomain obj10 = new AlibabaAlihealthDruguseQueryRequest.BuyAmountDomain();
obj10.BuyAmount = 5L;
obj10.HistoryDays = 10L;
obj10.HistoryTotalAmount = 20L;
obj5.BuyAmount= obj10;
AlibabaAlihealthDruguseQueryRequest.DrugDomain obj11 = new AlibabaAlihealthDruguseQueryRequest.DrugDomain();
obj11.CommonName = "茶碱缓释片";
obj11.QuantityPerPack = 24L;
obj11.TenantSpuId = "22244";
obj11.Producer = "锦州本天药业有限公司";
List<AlibabaAlihealthDruguseQueryRequest.IngredientsDomain> list13 = new List<AlibabaAlihealthDruguseQueryRequest.IngredientsDomain>();
AlibabaAlihealthDruguseQueryRequest.IngredientsDomain obj14 = new AlibabaAlihealthDruguseQueryRequest.IngredientsDomain();
list13.Add(obj14);
obj14.Unit = "mg";
obj14.Quantity = 10L;
obj14.Name = "青霉素类广谱β-内酰胺类抗生素";
obj11.Ingredients= list13;
obj11.SpuId = "511281473";
obj11.UnitOfPerUnit = "mg";
obj11.QuantityPerUnit = 10L;
obj11.ApprovalNumber = "国药准字H21020004";
obj11.Type = "WESTERN_PRESCRIPTION_MEDICINE";
obj11.Norm = "0.1g*24片/盒";
obj5.Drug= obj11;
obj1.PrescriptionItems= list4;
List<AlibabaAlihealthDruguseQueryRequest.DiagDomain> list16 = new List<AlibabaAlihealthDruguseQueryRequest.DiagDomain>();
AlibabaAlihealthDruguseQueryRequest.DiagDomain obj17 = new AlibabaAlihealthDruguseQueryRequest.DiagDomain();
list16.Add(obj17);
obj17.Code = "F42.900";
obj17.Name = "强迫性障碍";
obj1.Diags= list16;
obj1.TenantCode = "ele";
req.Command_ = obj1;
AlibabaAlihealthDruguseQueryResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaAlihealthDruguseQueryRequest;
$command = new SafeMedicationReqCommand;
$command->order_id="1838983105989823315";
$patient = new Patient;
$patient->gender="1";
$patient->weight="70";
$patient->user_id="22287869";
$patient->age="55";
$patient->height="175";
$patient->labels="[\"PREGNANCY\",\"LACTATION\",\"HYPOHEPATIA\",\"SEVERE_HYPOHEPATIA\",\"SEVERE_RENALINADEQUACY\",\"RENALINADEQUACY\"]";
$command->patient = $patient;
$command->scene_name="prescription";
$prescription_items = new PrescriptionItem;
$dosage = new Dosage;
$items = new DosageItem;
$items->unit="mg";
$items->type="SINGLEDAILYDOSE";
$items->value="10.0";
$dosage->items = $items;
$dosage->way="口服";
$prescription_items->dosage = $dosage;
$buy_amount = new BuyAmount;
$buy_amount->buy_amount="5";
$buy_amount->history_days="10";
$buy_amount->history_total_amount="20";
$prescription_items->buy_amount = $buy_amount;
$drug = new Drug;
$drug->common_name="茶碱缓释片";
$drug->quantity_per_pack="24";
$drug->tenant_spu_id="22244";
$drug->producer="锦州本天药业有限公司";
$ingredients = new Ingredients;
$ingredients->unit="mg";
$ingredients->quantity="10";
$ingredients->name="青霉素类广谱β-内酰胺类抗生素";
$drug->ingredients = $ingredients;
$drug->spu_id="511281473";
$drug->unit_of_per_unit="mg";
$drug->quantity_per_unit="10";
$drug->approval_number="国药准字H21020004";
$drug->type="WESTERN_PRESCRIPTION_MEDICINE";
$drug->norm="0.1g*24片/盒";
$prescription_items->drug = $drug;
$command->prescription_items = $prescription_items;
$diags = new Diag;
$diags->code="F42.900";
$diags->name="强迫性障碍";
$command->diags = $diags;
$command->tenant_code="ele";
$req->setCommand(json_encode($command));
$resp = $c->execute($req);
curl -X POST 'http://gw.api.taobao.com/router/rest' \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'app_key=12129701' \
-d 'format=json' \
-d 'method=alibaba.alihealth.druguse.query' \
-d 'partner_id=apidoc' \
-d 'sign=A088633DFC15A9340EF8A4304FF93C3E' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-04-29+16%3A10%3A54' \
-d 'v=2.0' \
-d 'command=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaAlihealthDruguseQueryRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.command=""
try:
resp= req.getResponse()
print(resp)
except Exception,e:
print(e)
pTopRequest pRequest = alloc_top_request();
pTopResponse pResponse = NULL;
pTaobaoClient pClient = alloc_taobao_client(url, appkey, appsecret);
set_api_name(pRequest,"alibaba.alihealth.druguse.query");
add_param(pRequest,"command","数据结构JSON示例");
pResponse = top_execute(pClient,pRequest,NULL);
printf("ret code:%d\n",pResponse->code);
if(pResponse->code == 0){
pTopResponseIterator ite = init_response_iterator(pResponse);
pResultItem pResultItem = alloc_result_item();
while(parseNext(ite, pResultItem) == 0){
printf("%s:%s\n",pResultItem->key,pResultItem->value);
}
destroy_response_iterator(ite);
destroy_result_item(pResultItem);
}
destroy_top_request(pRequest);
destroy_top_response(pResponse);
destroy_taobao_client(pClient);
TopClient = require('./topClient').TopClient;
var client = new TopClient({
'appkey': 'appkey',
'appsecret': 'secret',
'REST_URL': 'http://gw.api.taobao.com/router/rest'
});
client.execute('alibaba.alihealth.druguse.query', {
'command':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})