본문으로 바로가기 주메뉴 바로가기
본문시작

EMR 표준프레임워크

안전하고 체계적인 환자정보 관리를 위해 노력하겠습니다.

인증 기준 선택

인증기준(구)
*신구대비표 참조
I003(진료의뢰 정보 생성 조회)
분류
진료정보
유형별 필수 여부
  • 유형 1 : 선택
  • 유형 2 : 선택
  • 유형 3 : 선택
인증기준 설명

진료정보교류 시스템을 활용하여 환자의 진료의뢰 정보를 생성하고 조회할 수 있어야 함. 

개발가이드
보기(레이어 팝업)
산출소스

//진료의뢰서
Private Function Referral()
    Dim dto As New CDAObject
    //문서정보
    dto.DocumentInformation = New DocumentInformationObject
    dto.DocumentInformation.DocumentType = "1.2.410.100110.40.2.1.1"      //의뢰서
    //의료기관 OID
    dto.DocumentInformation.OrganizationOID = "1.2.410.100110.10.99995111"  

    //요양기관기호(8자리) + 발생일(yyMMdd) + 일련번호(5자리)
    //예시 : 요양기관 기호 - 99995111, 발생일 - 2018년 11월 30일 , 일련번호 - 1
    //예시값 : 9999511118113000001
    dto.DocumentInformation.RequestNumber = "99995111" + & _
                                               Format(Now, "yyMMdd") + "00001"

    //환자정보
    dto.Patient = New RecordTargetObject
    dto.Patient.LocalId = "001"                                            //환자D
    dto.Patient.PatientName = "홍비트“                                    //환자명
    dto.Patient.DateOfBirth = "19991231"                                  //생년월일
    dto.Patient.Gender = GenderType.Female                               //성별(Value Set참조)
    dto.Patient.TelecomNumber = "000-0000-0000"                         //연락처
    dto.Patient.AdditionalLocator = "서울서초구서초대로“                    //주소기본
    dto.Patient.StreetAddress = "74길33"                                   //주소상세
    dto.Patient.PostalCode = "06621"                                      //주소우편번호
    dto.Patient.CareType = CareTypes.INPATIENT                            //진료구분(Value Set참조)

    //의료기관정보
    dto.Custodian = New CustodianObject
    dto.Custodian.OID = "1.2.410.100110.10.99995111"                      //의료기관식별번호
    dto.Custodian.Id = "99995111"                                        //의료기관기호
    dto.Custodian.CustodianName = "1차의료기관“                         //의료기관명
    dto.Custodian.TelecomNumber = "000-0000-0000"                      //의료기관연락처
    dto.Custodian.AdditionalLocator = "서울서초구서초대로“                 //주소기본
    dto.Custodian.StreetAddress = "74길33"                                //주소상세
    dto.Custodian.PostalCode = "00000"                                   //주소우편번호

    //진료의
    dto.Author = New AuthorObject
    dto.Author.AuthorName = "이비트“                                    //의료진명
    dto.Author.MedicalLicenseID = "00001"                                //의료진면허번호
    dto.Author.TelecomNumber = "000-0000-0000"                        //의료진연락처
    dto.Author.DepartmentName = "외과                                  //진료과명(Value Set참조)
    dto.Author.DepartmentCode = "0400"                                 //진료과코드(Value Set참조)

    //문서작성자
    dto.Authenticator = New AuthenticatorObject
    dto.Authenticator.Id = "0001"                                         //문서작성자D
    dto.Authenticator.AuthenticatorName = "강비트“                       //문서작성자명
    dto.Authenticator.TelecomNumber = "000-0000-0000"                  //문서작성자연락처            
    //수신/전원기관정보
    Dim info1 As New InformationRecipientObject
    info1.OID = "1.2.410.100110.10.99995112"                           //요양기관식별번호
    info1.Id = "99995112"                                             //요양기관기호
    info1.OrganizationName = "3차의료기관"                           //요양기관명
    info1.TelecomNumber = "1599-1004"                               //요양기관연락처
    info1.DoctorName = "김의사"                                      //진료의명
    info1.AdditionalLocator = "서울시 서대문구 oo동"                   //주소(기본)
    info1.StreetAddress = "000 번지"                                   //주소(상세)
    info1.PostalCode = "00000"                                        //주소(우편번호)
    info1.DepartmentName = "가정의학과"                              //진료과명(Value Set참조)
    info1.DepartmentCode = "2300"                                    //진료과코드(Value Set참조)     
       dto.InformationRecipient = New InformationRecipientObject() {info1}

    //진단내역
    Dim prob1 As New ProblemObject
    prob1.StartDate = "20160201"                                   //진단일자
    prob1.ProblemName = "Cerebral venous sinus thrombosis"        //상병명
    prob1.ProblemCode = "I676"                                    //상병코드

    //KOSTOM 설정
    Dim kostomCodes1 As New KostomObject
    kostomCodes1.Code = "H02434733"                             //용어코드
    //영문명
    kostomCodes1.DisplayName = "Intracranial phlebitis and thrombophlebitis of nonpyogenic origin"  
    Dim kostomCodes2 As New KostomObject
    kostomCodes2.Code = "H01330551"                             //용어코드
    //영문명
    kostomCodes2.DisplayName = "Phlecitis and thrombophlebites(of) intracranial, nonpyogenic"       
    prob1.KostomCodes = New KostomObject() {kostomCodes1, kostomCodes2}
    dto.Problems = New ProblemObject() {prob1}

    //약물처방내역
    Dim medi1 As New MedicationObject
    medi1.StartDate = "20180423"                                 //처방일시
    //처방약품명
    medi1.MedicationName = "락티케어제마지스로션0.25%(프레드니카르베이트)_(0.15g/60g)"            
    medi1.MedicationCode = "653000412"                         //처방약품코드
    medi1.MajorComponent = "프레드니카르베이트"                //주성분명
    medi1.MajorComponentCode = "D07AC18"                     //주성분코드
    medi1.DoseQuantity = "1"                                    //용량
    medi1.DoseQuantityUnit = "g"                                //복용단위
    medi1.RepeatNumber = "2"                                  //횟수
    medi1.Period = "1"                                          //투여기간
    medi1.Usage = "rub 2/d"                                    //용법
    dto.Medications = New MedicationObject() {medi1}

    검사결과
    //검체검사
    Dim labSpec1 As New LaboratoryTestObject
    labSpec1.LabTypeString = "Specimen"                        //검사유형
    labSpec1.Date = "20160202"                                 //검사일시
    labSpec1.EntryName = "ABGA"                               //검사항목명
    labSpec1.EntryCode = "G2101"                               //검사항목코드
    labSpec1.TestName = "pH"                                   //검사명
    labSpec1.TestCode = "C3811"                                //검사코드
    labSpec1.ResultValue = "7.274"                                //검사결과값
    labSpec1.Reference = "7.38 ~ 7.46"                            //참고치

    //병리검사
    Dim labPath1 As New LaboratoryTestObject
    labPath1.LabTypeString = "Pathology"                                       //검사유형
    labPath1.Date = "20160205"                                                //검사일시
    labPath1.TestName = "QEEG"                                               //검사명
    labPath1.TestCode = "L8720"                                               //검사코드
    labPath1.ResultValue = "Summary: Negative for M. tuberculosis complex"     //검사결과

    //영상검사 - 1
    Dim labRadi1 As New LaboratoryTestObject
    labRadi1.LabTypeString = "Radiology"                     //검사유형
    labRadi1.Date = "20160205"                              //검사일시
    labRadi1.TestName = "Chest PA"                          //검사명
    labRadi1.TestCode = "RG2011"                            //검사코드
    labRadi1.ResultValue _                                    //검사결과
        = "The cardiomediastinum is within normal limits. The trachea is midline. " _
        + "The previously described opacity at the medial right lung base has cleared."              
    //Web PACS 기본 주소
    labRadi1.WebPacsBaseURL = "https://ihie.mychart.kr/hime-view/dicomWebView.jsp"                 
    labRadi1.AccessionNumber = "1210491"                   //PACS Accession Number                                                                    
    //영상검사 - 2
    Dim labRadi2 As New LaboratoryTestObject
    labRadi2.LabTypeString = "Radiology"                     //검사유형
    labRadi2.Date = "20160209"                              //검사일시
    labRadi2.TestName = "Chest PA"                          //검사명
    labRadi2.TestCode = "RG2011"                            //검사코드
    //검사결과
    labRadi2.ResultValue _
        = "The cardiomediastinum is within normal limits. The trachea is midline. " _
        + "The previously described opacity at the medial right lung base has cleared."              
    //Web PACS 기본 주소
    labRadi2.WebPacsBaseURL = "https://ihie.mychart.kr/hime-view/dicomWebView.jsp"    
    labRadi2.AccessionNumber = "14321679"                   //PACS Accession Number

    //기능검사
    Dim labFunc1 As New LaboratoryTestObject
    labFunc1.LabTypeString = "Functional"                      //검사유형
    labFunc1.Date = "20160205"                               //검사일시
    labFunc1.TestName = "ECG"                               //검사명
    labFunc1.TestCode = "KL1100"                             //검사코드
    labFunc1.ResultValue = "SINUS RHYTHM : normal P axis, V-rate 50-99"                                 //검사결과
    dto.LaboratoryTests = New LaboratoryTestObject() {labSpec1, labPath1, _
                                                    labRadi1, labRadi2, labFunc1}

    //수술/처치내역
    Dim proce1 As New ProcedureObject
    proce1.Date = "20121212"                                          //수술일자
    proce1.ProcedureName_ICD9CM = "laparoscopic cholecystectomy"     //수술명
    proce1.ProcedureCode_ICD9CM = "51.23"                            //수술코드
    proce1.PostDiagnosisName = "간경화(Hepatic sclerosis)"               //수술 후 진단명
    proce1.Anesthesia = "국부 마취"                                     //마취종류
    dto.Procedures = New ProcedureObject() {proce1}

    //알러지 및 부작용
    Dim aller1 As New AllergyObject
    aller1.StartDate = "20170201"                                    //등록일자
    aller1.AllergyType = "약물"                                       //알러지유형
    aller1.AllergyTypeCode = "H00501805"                            //알러지요인코드
    aller1.Allergy = "조영제"                                          //알러지명
    aller1.Reaction = "Wheezing"                                     //반응
    dto.Allergies = New AllergyObject() {aller1}

    //소견 및 주의사항
    dto.Assessment = New AssessmentObject
    dto.Assessment.PhysicalScienceLab = "large lymphoid cells and abundant karyorrhectic debris"
    dto.Assessment.Assessment = "차가운 음식을 삼가하시기 바랍니다."

    //의뢰사유(의뢰서)
    dto.ReasonForReferral = "가슴 통증을 호소하셨습니다. 고진선처 바랍니다."

    //예약관련정보(의뢰서)
    dto.PlanOfTreatment = New PlanOfTreatmentObject
    dto.PlanOfTreatment.PlannedDate = Format(Now.AddMonths(1), "yyyyMMdd")
    dto.PlanOfTreatment.Text = "Asprin 투약 후 상태 호전됨. 약물요법 시행 필요"

    //의뢰/회송정보(의뢰서) - 심평원연계 보험관련정보
    dto.ReferralTransferInformation = New ReferralTransferInformationObject
    dto.ReferralTransferInformation.ReferralCurrentStatus = "01"  //의뢰상태구분(Value Set참조)
    dto.ReferralTransferInformation.ReferralClinicalReason = "02"  //임상적 의뢰사유구분(Value Set참조)
    dto.ReferralTransferInformation.NonClinicalReason = "03"     //비임상적 의뢰사유구분(Value Set참조)

    Return dto
End Function

//교류문서등록
Private Sub AddDocument()
    Try
    SetEndpoint()             //Endpoint 입력함수호출
    //요청모델생성영역=======================================================
    Dim objDocumentExchangeService As New DocumentExchangeService _
    (
     senderCertificatePath,                             //보내는측 pfx 파일 경로
     certPassword,                                    //보내는측 pfx 파일 암호
     urlRegistryStoredQueryService,                     //교류문서메타정보조회Url
     urlProvideAndRegisterDocumentSetService,         //교류문서 등록Url
     urlRetrieveDocumentSetService,                    //교류문서/첨부파일조회
     urlUpdateDocumentSetService,                     
     urlAddNotificationInfo,                            //교류문서/알림정보 등록
     //교류문서상태등록/교류상태히스토리조회/현재교류상태조회 
     urlReferralStatusService + "/AddReferralStatus"     
    )
    Dim objAddDocumentRequest As New AddDocumentRequestObject

    //생성한CDA 모델
    objAddDocumentRequest.CDAObjects = {Referral()}                                 //진료의뢰서
    objAddDocumentRequest.MPIId = 
           "046f6488-181b-4a8b-9a19-03d724331a8e^^^&1.2.410.100110.40.1.3.1&ISO"   //환자식별번호
    objAddDocumentRequest.SourceId = "1.2.410.100110.10.99995111"                   //의료기관ID
    objAddDocumentRequest.ReferralId = ""                   //의뢰서D (회신일경우필수)
    //첨부파일정보
    objAddDocumentRequest.Attachments =
    {     //첨부파일경로
         New AttachmentObject With {.AttachFileFullPath = 파일폴더+\TestData\attach1.jpg"}
    }                                                                                          
    objAddDocumentRequest.InsurerCategory = "4"             //보험자종별구분
    //보훈위탁진료요양기관의상이처무자격자또는보훈병원의국비일반 국비보험
    'objAddDocumentRequest.InsurerCategory = "7"                                              
    objAddDocumentRequest.HIRAPatConsentConfirm = "Y"      //심평원환자동의확인
    objAddDocumentRequest.HIRAMedStaffConsent = "Y"        //심평원의료진동의
    objAddDocumentRequest.ReqInfo = SetClientInfo()           //사용자정보입력
    objDocumentExchangeService.ReqModelAddDocument = objAddDocumentRequest

    //모델전송수신영역================================================= 
    objDocumentExchangeService.AddDocument()
    //응답모델추출영역=================================================
    //응답정보
    Dim sResult As String = 
         ("등록결과, objDocumentExchangeService.RespModelAddDocument.ResponseStatus) & _
         ("알림정보등록상태,objDocumentExchangeService.RespModelAddDocument.AddNotificationStatus)
    //등록문서정보
    If Not (objDocumentExchangeService.RespModelAddDocument.RegisteredDocument Is Nothing) _
      And objDocumentExchangeService.RespModelAddDocument.RegisteredDocument.Length > 0 Then
        For i = 0 To objDocumentExchangeService.RespModelAddDocument.RegisteredDocument.Length - 1
            datgrd.Rows.Add("   # " & (i + 1))
            datgrd.Rows.Add("   문서유일번호, objDocumentExchangeService.RespModelAddDocument.RegisteredDocument(i).DocumentUniqueId)
            datgrd.Rows.Add("   문서명, objDocumentExchangeService.RespModelAddDocument.RegisteredDocument(i).Title)
            //KOS 정보목록
            If Not (objDocumentExchangeService.RespModelAddDocument.RegisteredDocument(i).KosInfoList Is Nothing) _
                        And objDocumentExchangeService.RespModelAddDocument.RegisteredDocument(i).KosInfoList.Length > 0 Then
                For j = 0 To objDocumentExchangeService.RespModelAddDocument.RegisteredDocument(i).KosInfoList.Length - 1
                    datgrd.Rows.Add("       # " & (j + 1))
                    datgrd.Rows.Add("       KOS 개체nique ID", objDocumentExchangeService.RespModelAddDocument.RegisteredDocument(i).KosInfoList(j).KosInstanceUid)
                    datgrd.Rows.Add("       영상검사처방ey", objDocumentExchangeService.RespModelAddDocument.RegisteredDocument(i).KosInfoList(j).AccessNo)
                Next
            End If
            
            //CDA 뷰어
            //등록문서 의뢰서뷰어양식
            webbrowserCDA.DocumentText = transformXmlToHtmlWithXsl _
            (
               objDocumentExchangeService.RespModelAddDocument.RegisteredDocument(i).Document,
                            Path + "\StyleSheet\CDA_StyleSheet_Total_ver6.xsl"
            )          
        Next
    End If           
    //===============================================================
    Catch ex As Exception
        MessageBox.Show("에러 " + ex.ToString())
    End Try
End Sub