Skip to content

Commit

Permalink
refactor: change to generate by typescript
Browse files Browse the repository at this point in the history
building with typescript.

BREAKING CHANGE: building with typescript.
  • Loading branch information
JieuTang committed Jul 29, 2022
1 parent 5b3c0ef commit 00b937a
Show file tree
Hide file tree
Showing 15 changed files with 1,232 additions and 868 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/lib

# Logs
logs
*.log
Expand Down
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"printWidth": 120,
"trailingComma": "all",
"singleQuote": true
}
5 changes: 0 additions & 5 deletions Config/QueryLevel.json

This file was deleted.

158 changes: 0 additions & 158 deletions DICOMwebQIDORS.js

This file was deleted.

71 changes: 63 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# CSY-DICOMweb-QIDO-RS
This private repository generates the URL and requests PACS for DICOMweb QIDO-RS.
This repository generates the URL and requests PACS for DICOMweb QIDO-RS.
This repository was built by typescript.

## DICOM QIDO Parameter
### Required Matching Attributes
Expand All @@ -14,11 +15,63 @@ DICOM PS3.18 2022b => 8.3 Query Parameters => Table 8.3.4-1. Query Parameter Syn
> https://dicom.nema.org/medical/dicom/2022b/output/chtml/part18/sect_8.3.4.html#sect_8.3.4.1
DICOM PS3.18 2022b => 8.3 Query Parameters => Table 8.3.4-1. Query Parameter Syntax
# How to use
```javascript
//引入套件
# How to use : Typescript
```typescript
// 引入套件
import QIDO from "csy-dicomweb-qido-rs";
import _ from "lodash";


// 實體化
const qido = new QIDO();

myFun();

async function myFun() {

// "必須"自己初始化
await qido.init();

// 查詢階層設定:studies、series、instances
qido.queryLevel = "studies";

// 有使用到的套件參數設定:url-parse package
qido.hostname = "test.dicom.tw";
qido.pathname = "/dicomWeb";
qido.protocol = "http";
qido.port = "999";


// 查詢參數設定:DICOM QIDO-RS Parameter
let tempQueryParameter = {};

tempQueryParameter = _.set(tempQueryParameter, "PatientID", "*");
tempQueryParameter = _.set(tempQueryParameter, "limit", "10");
tempQueryParameter = _.set(tempQueryParameter, "offset", "0");

// 查詢參數用物件套入
qido.queryParameter = tempQueryParameter;


// 設定 Token:現在尚未啟用
// let myHeaders = {};
// myHeaders = _.set(myHeaders, "token", "jf903j2vunf9843nvyf934qc");
// await qido.setUseToken(myHeaders);


//查詢 同步模式
await qido.query();
console.log(qido.response);
}

```


# How to use : Javascript
```javascript
import QIDO from "csy-dicomweb-qido-rs";

(async () => {
//實體化
let qido = new QIDO();

Expand All @@ -29,10 +82,10 @@ await qido.init();
qido.queryLevel = "studies";

//有使用到的套件參數設定:url-parse package
qido.hostname = "test.dicom.tw";
qido.pathname = "/dicomWeb";
qido.protocol = "http";
qido.port = "999";
qido.hostname = "hackathon.raccoon.dicom.tw";
qido.pathname = "/dicom-web";
qido.protocol = "https";
qido.port = "443";

//查詢參數設定:DICOM QIDO-RS Parameter
let tempQueryParameter = {};
Expand All @@ -54,4 +107,6 @@ await qido.query();

//印出 response: json
console.log(qido.response);

})()
```
File renamed without changes.
Loading

0 comments on commit 00b937a

Please sign in to comment.