main
parent a018d182f3
commit 2c7812a68a

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

@ -0,0 +1,26 @@
inputFile: ДВН1-09.xlsx
outputFile: ДВН1.json
sheet: Лист1
startRow: 2
columns:
B: caseId # Ид случая
C: ticketNo # Номер талона
D: patientName # ФИО пациента
E: birthDate # Дата рождения
F: policyNumber # Номер полиса
G: volumeCode # Код объема
H: visitCode # Код посещения
I: amount # Сумма
J: diagnosCode # Код диагноза
K: department # Отделение
L: profile # Профиль
M: unit # Подразделение
N: doctor # Врач
O: specialty # Специальность
P: visit # Посещение
Q: yetCode # УЕТ
R: payment # Оплата
S: smo # СМО
T: prev # Подавался ранее

Binary file not shown.

File diff suppressed because it is too large Load Diff

@ -0,0 +1,26 @@
inputFile: ДВН2-09.xlsx
outputFile: ДВН2.json
sheet: Лист1
startRow: 2
columns:
B: caseId # Ид случая
C: ticketNo # Номер талона
D: patientName # ФИО пациента
E: birthDate # Дата рождения
F: policyNumber # Номер полиса
G: volumeCode # Код объема
H: visitCode # Код посещения
I: amount # Сумма
J: diagnosCode # Код диагноза
K: department # Отделение
L: profile # Профиль
M: unit # Подразделение
N: doctor # Врач
O: specialty # Специальность
P: visit # Посещение
Q: yetCode # УЕТ
R: payment # Оплата
S: smo # СМО
T: prev # Подавался ранее

@ -2,11 +2,11 @@ import PocketBase from "pocketbase";
const pb = new PocketBase("http://localhost:8090"); const pb = new PocketBase("http://localhost:8090");
await pb.collection("_superusers").authWithPassword('tad17@list.ru', '0987654321'); await pb.collection("_superusers").authWithPassword('tad17@list.ru', '0987654321');
async function appendItem(item) { async function appendItem(table_name, item) {
//console.log("item:", item) //console.log("item:", item)
try { try {
const p = await pb.collection("rmias").create(item) const p = await pb.collection(table_name).create(item)
//console.log("ответ PocketBase:", p) //console.log("ответ PocketBase:", p)
//console.log("запись:", p.id, p.patientName); //console.log("запись:", p.id, p.patientName);
} catch (err) { } catch (err) {
@ -15,13 +15,13 @@ async function appendItem(item) {
} }
} }
async function importJSON() { async function importJSON(json_name, table_name) {
const items = await Bun.file("excel/tsa.json").json(); const items = await Bun.file(json_name).json();
console.log(`Прочитано: ${items.length} записей`) console.log(`Прочитано: ${items.length} записей`)
let appended = 0 let appended = 0
for (const item of items) { for (const item of items) {
await appendItem(item) await appendItem(table_name, item)
appended++ appended++
} }
console.log(`Загружено: ${appended} записей`) console.log(`Загружено: ${appended} записей`)
@ -65,6 +65,6 @@ async function test() {
//test() //test()
await clearCollection("rmias"); //await clearCollection("rmias");
await importJSON() await importJSON("excel/ДВН2.json", "dvn2")
console.log("Готово") console.log("Готово")

@ -0,0 +1,337 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = new Collection({
"createRule": "",
"deleteRule": "",
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3338851614",
"max": 0,
"min": 0,
"name": "caseId",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3747851106",
"max": 0,
"min": 0,
"name": "ticketNo",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text532738922",
"max": 0,
"min": 0,
"name": "doctor",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text4045201499",
"max": 0,
"min": 0,
"name": "patientName",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text852947741",
"max": 0,
"min": 0,
"name": "birthDate",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2697101061",
"max": 0,
"min": 0,
"name": "policyNumber",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2982690215",
"max": 0,
"min": 0,
"name": "volumeCode",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text186973863",
"max": 0,
"min": 0,
"name": "finVolumeCode",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2724104176",
"max": 0,
"min": 0,
"name": "visitCode",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2392944706",
"max": 0,
"min": 0,
"name": "amount",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text1567889211",
"max": 0,
"min": 0,
"name": "diagnosCode",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3441287562",
"max": 0,
"min": 0,
"name": "department",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2170006031",
"max": 0,
"min": 0,
"name": "profile",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3703245907",
"max": 0,
"min": 0,
"name": "unit",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3764823788",
"max": 0,
"min": 0,
"name": "specialty",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text1132390713",
"max": 0,
"min": 0,
"name": "visit",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text1184158426",
"max": 0,
"min": 0,
"name": "yetCode",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text1831371789",
"max": 0,
"min": 0,
"name": "payment",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2762499640",
"max": 0,
"min": 0,
"name": "smo",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3168962645",
"max": 0,
"min": 0,
"name": "prev",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"hidden": false,
"id": "autodate2990389176",
"name": "created",
"onCreate": true,
"onUpdate": false,
"presentable": false,
"system": false,
"type": "autodate"
},
{
"hidden": false,
"id": "autodate3332085495",
"name": "updated",
"onCreate": true,
"onUpdate": true,
"presentable": false,
"system": false,
"type": "autodate"
}
],
"id": "pbc_3445814889",
"indexes": [],
"listRule": "",
"name": "rmias_duplicate",
"system": false,
"type": "base",
"updateRule": "",
"viewRule": ""
});
return app.save(collection);
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_3445814889");
return app.delete(collection);
})

@ -0,0 +1,20 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_3445814889")
// update collection data
unmarshal({
"name": "dvn1"
}, collection)
return app.save(collection)
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_3445814889")
// update collection data
unmarshal({
"name": "rmias_duplicate"
}, collection)
return app.save(collection)
})

@ -0,0 +1,29 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_3445814889")
// remove field
collection.fields.removeById("text186973863")
return app.save(collection)
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_3445814889")
// add field
collection.fields.addAt(8, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text186973863",
"max": 0,
"min": 0,
"name": "finVolumeCode",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
return app.save(collection)
})

@ -0,0 +1,323 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = new Collection({
"createRule": "",
"deleteRule": "",
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3338851614",
"max": 0,
"min": 0,
"name": "caseId",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3747851106",
"max": 0,
"min": 0,
"name": "ticketNo",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text4045201499",
"max": 0,
"min": 0,
"name": "patientName",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text852947741",
"max": 0,
"min": 0,
"name": "birthDate",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2697101061",
"max": 0,
"min": 0,
"name": "policyNumber",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2982690215",
"max": 0,
"min": 0,
"name": "volumeCode",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2724104176",
"max": 0,
"min": 0,
"name": "visitCode",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2392944706",
"max": 0,
"min": 0,
"name": "amount",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text1567889211",
"max": 0,
"min": 0,
"name": "diagnosCode",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3441287562",
"max": 0,
"min": 0,
"name": "department",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2170006031",
"max": 0,
"min": 0,
"name": "profile",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3703245907",
"max": 0,
"min": 0,
"name": "unit",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text532738922",
"max": 0,
"min": 0,
"name": "doctor",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3764823788",
"max": 0,
"min": 0,
"name": "specialty",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text1132390713",
"max": 0,
"min": 0,
"name": "visit",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text1184158426",
"max": 0,
"min": 0,
"name": "yetCode",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text1831371789",
"max": 0,
"min": 0,
"name": "payment",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2762499640",
"max": 0,
"min": 0,
"name": "smo",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3168962645",
"max": 0,
"min": 0,
"name": "prev",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"hidden": false,
"id": "autodate2990389176",
"name": "created",
"onCreate": true,
"onUpdate": false,
"presentable": false,
"system": false,
"type": "autodate"
},
{
"hidden": false,
"id": "autodate3332085495",
"name": "updated",
"onCreate": true,
"onUpdate": true,
"presentable": false,
"system": false,
"type": "autodate"
}
],
"id": "pbc_3520650163",
"indexes": [],
"listRule": "",
"name": "dvn2",
"system": false,
"type": "base",
"updateRule": "",
"viewRule": ""
});
return app.save(collection);
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_3520650163");
return app.delete(collection);
})

@ -0,0 +1,64 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3208210256",
"max": 0,
"min": 0,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "_clone_OhO7",
"max": 0,
"min": 0,
"name": "doctor",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"hidden": false,
"id": "number432430951",
"max": null,
"min": null,
"name": "cnt",
"onlyInt": false,
"presentable": false,
"required": false,
"system": false,
"type": "number"
}
],
"id": "pbc_3856397659",
"indexes": [],
"listRule": null,
"name": "dvn_by_doctor",
"system": false,
"type": "view",
"updateRule": null,
"viewQuery": "select \n (ROW_NUMBER() OVER()) as id,\n doctor, \n count(doctor) as cnt\nfrom dvn2\ngroup by doctor\n",
"viewRule": null
});
return app.save(collection);
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_3856397659");
return app.delete(collection);
})

@ -0,0 +1,58 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_3856397659")
// update collection data
unmarshal({
"viewQuery": "select \n (ROW_NUMBER() OVER()) as id,\n doctor, \n count(doctor) as cnt\nfrom dvn1\n where diagnosCode = \"I45.1\"\ngroup by doctor\n"
}, collection)
// remove field
collection.fields.removeById("_clone_OhO7")
// add field
collection.fields.addAt(1, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "_clone_9Xsr",
"max": 0,
"min": 0,
"name": "doctor",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
return app.save(collection)
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_3856397659")
// update collection data
unmarshal({
"viewQuery": "select \n (ROW_NUMBER() OVER()) as id,\n doctor, \n count(doctor) as cnt\nfrom dvn2\ngroup by doctor\n"
}, collection)
// add field
collection.fields.addAt(1, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "_clone_OhO7",
"max": 0,
"min": 0,
"name": "doctor",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
// remove field
collection.fields.removeById("_clone_9Xsr")
return app.save(collection)
})

@ -0,0 +1,58 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_3856397659")
// update collection data
unmarshal({
"viewQuery": "select \n (ROW_NUMBER() OVER()) as id,\n doctor, \n count(doctor) as cnt\nfrom dvn1\n where diagnosCode = \"K86.1\"\ngroup by doctor\n"
}, collection)
// remove field
collection.fields.removeById("_clone_9Xsr")
// add field
collection.fields.addAt(1, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "_clone_SvwX",
"max": 0,
"min": 0,
"name": "doctor",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
return app.save(collection)
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_3856397659")
// update collection data
unmarshal({
"viewQuery": "select \n (ROW_NUMBER() OVER()) as id,\n doctor, \n count(doctor) as cnt\nfrom dvn1\n where diagnosCode = \"I45.1\"\ngroup by doctor\n"
}, collection)
// add field
collection.fields.addAt(1, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "_clone_9Xsr",
"max": 0,
"min": 0,
"name": "doctor",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
// remove field
collection.fields.removeById("_clone_SvwX")
return app.save(collection)
})

@ -0,0 +1,60 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_3856397659")
// update collection data
unmarshal({
"listRule": "",
"viewRule": ""
}, collection)
// remove field
collection.fields.removeById("_clone_SvwX")
// add field
collection.fields.addAt(1, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "_clone_EBPK",
"max": 0,
"min": 0,
"name": "doctor",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
return app.save(collection)
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_3856397659")
// update collection data
unmarshal({
"listRule": null,
"viewRule": null
}, collection)
// add field
collection.fields.addAt(1, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "_clone_SvwX",
"max": 0,
"min": 0,
"name": "doctor",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
// remove field
collection.fields.removeById("_clone_EBPK")
return app.save(collection)
})

@ -0,0 +1,10 @@
async function gett() {
const result = await fetch("http://localhost:8090/api/collections/dvn_by_doctor/records")
const rr = await result.json()
return rr
}
const doctors = await gett()
console.log(doctors)

@ -0,0 +1,26 @@
inputFile: ДВН1-09.xlsx
outputFile: ДВН1.json
sheet: Лист1
startRow: 2
columns:
B: caseId # Ид случая
C: ticketNo # Номер талона
D: patientName # ФИО пациента
E: birthDate # Дата рождения
F: policyNumber # Номер полиса
G: volumeCode # Код объема
H: visitCode # Код посещения
I: amount # Сумма
J: diagnosCode # Код диагноза
K: department # Отделение
L: profile # Профиль
M: unit # Подразделение
N: doctor # Врач
O: specialty # Специальность
P: visit # Посещение
Q: yetCode # УЕТ
R: payment # Оплата
S: smo # СМО
T: prev # Подавался ранее
Loading…
Cancel
Save