// 1.1 讀取不需個人PIN碼資料
extern "C" int __stdcall hisGetBasicData (char *pBuffer,short *iBufferLen);
// 1.2 掛號或報到時讀取基本資料
extern "C" int __stdcall hisGetRegisterBasic(char *pBuffer,short *iBufferLen);
// 1.3 預防保健掛號作業
extern "C" int __stdcall hisGetRegisterPrevent(char *pBuffer,short *iBufferLen) ;
// 1.4 孕婦產前檢查掛號作業
extern "C" int __stdcall hisGetRegisterPregnant(char *pBuffer,short *iBufferLen);
// 1.5 讀取就醫資料不需HPC卡的部份
extern "C" int __stdcall hisGetTreatmentNoNeedHPC(char *pBuffer,short *iBufferLen) ; 
// 1.6 讀取就醫累計資料
extern "C" int __stdcall hisGetCumulativeData(char *pBuffer,short *iBufferLen);
// 1.7 讀取醫療費用線累計
extern "C" int __stdcall hisGetCumulativeFee(char *pBuffer,short *iBufferLen) ;
// 1.8 讀取就醫資料需HPC卡的部份
extern "C" int __stdcall hisGetTreatmentNeedHPC(char *pBuffer,short *iBufferLen);
// 1.9 取得就醫序號
extern "C" int __stdcall hisGetSeqNumber(char *cTreatItem, char *cBabyTreat, char *pBuffer,short *iBufferLen) ;
// 1.10 讀取處方箋作業
extern "C" int __stdcall hisReadPrescription(char *pOutpatientPrescription, short *iBufferLenOutpatient,
 				                          char *pLongTermPrescription, short *iBufferLenLongTerm,
				                          char *pImportantTreatmentCode, short *iBufferLenImportant,
				                          char *pIrritationDrug, short *iBufferLenIrritation) ;					  
// 1.11 讀取預防接種資料
extern "C" int __stdcall hisGetInoculateData(char *pBuffer,short *iBufferLen) ;					  
// 1.12 讀取同意器官捐贈及安寧緩和醫療註記
extern "C" int __stdcall hisGetOrganDonate(char *pBuffer,short *iBufferLen);
// 1.13 讀取緊急聯絡電話資料
extern "C" int __stdcall hisGetEmergentTel(char *pBuffer,short *iBufferLen);
// 1.14 讀取最近一次就醫序號
extern "C" int __stdcall hisGetLastSeqNum(char *pBuffer,short *iBufferLen);
// 1.15 讀取卡片狀態
extern "C" int __stdcall hisGetCardStatus(short CardType);
// 1.16 就醫診療資料寫入作業
extern "C" int __stdcall hisWriteTreatmentCode(char *pDateTime, char *pPatientID, char *pPatientBirthDate,
	                                                char *pDataWrite, char *pBufferDocID) ;
// 1.17 就醫費用資料寫入作業	                                                
extern "C" int __stdcall hisWriteTreatmentFee(char *pDateTime, 
							   char *pPatientID, 
							   char *pPatientBirthDate,
							   char *pDataWrite); 
// 1.18 處方箋寫入作業
extern "C" int __stdcall hisWritePrescription(char *pDateTime, char *pPatientID, char *pPatientBirthDate, char *pDataWrite) ;
// 1.19 新生兒註記寫入作業
extern "C" int __stdcall hisWriteNewBorn(char *pPatientID, 
						      char *pPatientBirthDate, 
						      char *pNewBornDate,
						      char *pNoOfDelivered) ;
// 1.20 過敏藥物寫入作業									 
extern "C" int __stdcall hisWriteAllergicMedicines(char *pPatientID, char *pPatientBirthDate,
	                                                        char *pDataWrite, char *pBufferDocID) ;
// 1.21 同意器官捐贈及安寧緩和醫療註記寫入作業
extern "C" int __stdcall hisWriteOrganDonate(char *pPatientID, char *pPatientBirthDate, char *pOrganDonate);
// 1.22 預防保健資料寫入作業
extern "C" int __stdcall hisWriteHealthInsurance(char *pPatientID, char *pPatientBirthDate,
	                                                      char *pServiceItem, char *pServiceItemCode) ;
// 1.23 緊急聯絡電話資料寫入作業
extern "C" int __stdcall hisWriteEmergentTel(char *pPatientID, char *pPatientBirthDate, char *pEmergentTel) ;
// 1.24 寫入產前檢查資料
extern "C" int __stdcall hisWritePredeliveryCheckup(char *pPatientID, char *pPatientBirthDate, char *pCheckupCode) ;
// 1.25 清除產前檢查資料
extern "C" int __stdcall hisDeletePredeliveryData(char *pPatientID, char *pPatientBirthDate) ;
// 1.26 預防接種資料寫入作業
extern "C" int __stdcall hisWriteInoculateData(char *pPatientID, char *pPatientBirthDate, char *pItem, char * pPackageNumber) ;
// 1.27 驗證健保IC卡之PIN值
extern "C" int __stdcall csVerifyHCPIN() ;
// 1.28 輸入新的健保IC卡PIN值
extern "C" int __stdcall csInputHCPIN();
// 1.29 停用健保IC卡之PIN碼輸入功能
extern "C" int __stdcall csDisableHCPIN() ;
// 1.30 健保IC卡卡片內容更新作業
extern "C" int __stdcall csUpdateHCContents();
// 1.31 開啟讀卡機連結埠
extern "C" int __stdcall csOpenCom(int pComNum) ;
// 1.32 關閉讀卡機連結埠
extern "C" int __stdcall csCloseCom() ;
// 1.33 讀取重大傷病註記資料
extern "C" int __stdcall hisGetCriticalIllness (char *pBuffer,short *iBufferLen);
// 1.34 讀取讀卡機日期時間
extern "C" int __stdcall  csGetDateTime(char *pBuffer,  short *iBufferLen);
// 1.35 讀取卡片號碼
extern "C" int __stdcall  csGetCardNo(short CardType, char *pBuffer,  short *iBufferLen);
// 1.36 檢查HC是否設定PIN碼
extern "C" int __stdcall  csISSetPIN();
// 1.37 取得就醫序號(新版)
extern "C" int __stdcall hisGetSeqNumber256(char *cTreatItem, char *cBabyTreat, char *cTreatAfterCheck, char *pBuffer,short *iBufferLen);
// 1.38 掛號或報到時讀取基本資料
extern "C" int __stdcall hisGetRegisterBasic2(char *pBuffer ,short *iBufferLen);
// 1.39 回復就醫資料累計值（退掛）
extern int csUnGetSeqNumber(char *pUnTreatDate);
// 1.40 健保IC卡卡片內容更新作業(不重置)
extern "C" int __stdcall csUpdateHCNoReset();

// *****************************************
// 以下為1.51版新增
// *****************************************

extern "C" int __stdcall hisReadPrescriptMain(char *pOutpatientPrescription, int *iBufferLenOutpatient, int iStartPos, int iEndPos,int *iRecCount); //門診處方箋
extern "C" int __stdcall hisReadPrescriptLongTerm(char *pLongTermPrescription, int *iBufferLenLongTerm, int iStartPos, int iEndPos,int *iRecCount); //長期處方箋
extern "C" int __stdcall hisReadPrescriptHVE(char *pImportantTreatmentCode, int *iBufferLenImportant, int iStartPos, int iEndPos,int *iRecCount); //重要醫令
extern "C" int __stdcall hisReadPrescriptAllergic(char *pIrritationDrug, int *iBufferLenIrritation, int iStartPos, int iEndPos,int *iRecCount); //過敏藥物
extern "C" int __stdcall hisWriteMultiPrescript(char *pDateTime,char *pPatientID,char *pPatientBirthDate,char *pDataWrite,int *iWriteCount); //多筆醫令
extern "C" int __stdcall hisWriteAllergicNum(char *pPatientID, char *pPatientBirthDate,
	                                                        char *pDataWrite, char *pBufferDocID, int iNum);  //指定寫入過敏藥物

// *****************************************
// 以上為1.51版新增
// *****************************************


// 2.1 SAM與DC認證
extern "C" int __stdcall csVerifySAMDC();
// 3.1 資料上傳
extern "C" int __stdcall csUploadData(char *pUploadFileName, char *pFileSize,char *pNumber, char *pBuffer, int *iBufferLen);
// 4.1 取得醫事人員卡狀態
extern "C" int __stdcall hpcGetHPCStatus(int Req, short *Status) ;
// 4.2 檢查醫事人員卡之PIN值
extern "C" int __stdcall hpcVerifyHPCPIN() ;
// 4.3 輸入新的醫事人員卡之PIN值
extern "C" int __stdcall hpcInputHPCPIN() ;
// 4.4 解開鎖住的醫事人員卡
extern "C" int __stdcall hpcUnlockHPC() ;
// 4.5 取得醫事人員卡序號
extern "C" int __stdcall hpcGetHPCSN(char *pBuffer, short *iBufferLen) ;
// 4.6 取得醫事人員卡身份證字號
extern "C" int __stdcall hpcGetHPCSSN(char *pBuffer, short *iBufferLen) ;
// 4.7 取得醫事人員卡中文姓名
extern "C" int __stdcall hpcGetHPCCNAME(char *pBuffer, short *iBufferLen) ;
// 4.8 取得醫事人員卡英文姓名
extern "C" int __stdcall hpcGetHPCENAME(char *pBuffer, short *iBufferLen) ;
