Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pac
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tools
pac
Commits
c888729e
Commit
c888729e
authored
Oct 21, 2026
by
luoqi
Browse files
Options
Browse Files
Download
Plain Diff
Merge Meyer manual operation ownership guard into test
parents
d1c30148
4c15d765
Pipeline
#3846
failed in 0 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletions
+13
-1
apps/pac-service/src/cli/meyer-imaging.cli.ts
+8
-1
apps/pac-service/tests/meyer-imaging-postgres.spec.ts
+5
-0
No files found.
apps/pac-service/src/cli/meyer-imaging.cli.ts
View file @
c888729e
...
@@ -8,7 +8,7 @@ import { loadMeyerScopes, loadMeyerScopeResults } from '../integrations/meyer/or
...
@@ -8,7 +8,7 @@ import { loadMeyerScopes, loadMeyerScopeResults } from '../integrations/meyer/or
import
{
ConfigSchema
,
InputConfigSchema
,
hash
,
imageKey
}
from
'../integrations/meyer/contracts'
;
import
{
ConfigSchema
,
InputConfigSchema
,
hash
,
imageKey
}
from
'../integrations/meyer/contracts'
;
import
{
MeyerClient
}
from
'../integrations/meyer/client'
;
import
{
MeyerClient
}
from
'../integrations/meyer/client'
;
import
{
collectMeyer
}
from
'../integrations/meyer/collector'
;
import
{
collectMeyer
}
from
'../integrations/meyer/collector'
;
import
{
prepareClinicStates
}
from
'../integrations/meyer/clinic-state'
;
import
{
prepareClinicStates
,
clinicStateStore
}
from
'../integrations/meyer/clinic-state'
;
import
{
backfillMeyerFileRefs
}
from
'../integrations/meyer/backfill-file-refs'
;
import
{
backfillMeyerFileRefs
}
from
'../integrations/meyer/backfill-file-refs'
;
import
{
PrismaClient
}
from
'@prisma/client'
;
import
{
PrismaClient
}
from
'@prisma/client'
;
import
{
loadDiagnosisCodes
}
from
'../integrations/meyer/mapper'
;
import
{
loadDiagnosisCodes
}
from
'../integrations/meyer/mapper'
;
...
@@ -84,6 +84,13 @@ export async function runMeyerCli(argv: string[], isolateWatchFailures = false):
...
@@ -84,6 +84,13 @@ export async function runMeyerCli(argv: string[], isolateWatchFailures = false):
await
validateTarget
();
await
validateTarget
();
const
previous
=
await
store
.
read
<
{
target
:
string
}
>
(
'database'
);
const
previous
=
await
store
.
read
<
{
target
:
string
}
>
(
'database'
);
if
(
!
previous
)
await
store
.
write
(
'database'
,
{
target
});
if
(
!
previous
)
await
store
.
write
(
'database'
,
{
target
});
// 手动固定窗口、补引用和取址也保留原诊所归属闸;tick 在逐诊所执行时单独隔离。
if
(
!
args
.
tick
)
for
(
const
scope
of
config
.
scopes
)
{
const
state
=
clinicStateStore
(
store
,
scope
);
const
previousScope
=
await
state
.
read
(
'scope'
);
if
(
previousScope
&&
hash
(
previousScope
)
!==
hash
(
scope
))
throw
new
Error
(
'clinic ownership mapping changed'
);
if
(
!
previousScope
)
await
state
.
write
(
'scope'
,
scope
);
}
if
(
args
.
backfillFileRefs
)
{
if
(
args
.
backfillFileRefs
)
{
const
db
=
new
PrismaClient
();
const
db
=
new
PrismaClient
();
try
{
try
{
...
...
apps/pac-service/tests/meyer-imaging-postgres.spec.ts
View file @
c888729e
...
@@ -19,6 +19,7 @@ import { codes } from './meyer-imaging-fixtures';
...
@@ -19,6 +19,7 @@ import { codes } from './meyer-imaging-fixtures';
import
{
meyerBundle
}
from
'./meyer-imaging-fixtures'
;
import
{
meyerBundle
}
from
'./meyer-imaging-fixtures'
;
import
{
meyerConfig
,
meyerImage
,
meyerSymptom
}
from
'./meyer-imaging-fixtures'
;
import
{
meyerConfig
,
meyerImage
,
meyerSymptom
}
from
'./meyer-imaging-fixtures'
;
import
{
runMeyerCli
}
from
'../src/cli/meyer-imaging.cli'
;
import
{
runMeyerCli
}
from
'../src/cli/meyer-imaging.cli'
;
import
{
clinicStateStore
}
from
'../src/integrations/meyer/clinic-state'
;
import
{
backfillMeyerFileRefs
}
from
'../src/integrations/meyer/backfill-file-refs'
;
import
{
backfillMeyerFileRefs
}
from
'../src/integrations/meyer/backfill-file-refs'
;
import
{
mkdtemp
,
writeFile
,
rm
}
from
'node:fs/promises'
;
import
{
mkdtemp
,
writeFile
,
rm
}
from
'node:fs/promises'
;
import
{
join
}
from
'node:path'
;
import
{
join
}
from
'node:path'
;
...
@@ -367,6 +368,10 @@ describePg('Meyer | isolated PostgreSQL + actual minimal CLI module', () => {
...
@@ -367,6 +368,10 @@ describePg('Meyer | isolated PostgreSQL + actual minimal CLI module', () => {
expect
(
await
prisma
.
followupPlan
.
count
()).
toBe
(
0
);
expect
(
await
prisma
.
followupPlan
.
count
()).
toBe
(
0
);
expect
(
await
prisma
.
persona
.
count
()).
toBe
(
0
);
expect
(
await
prisma
.
persona
.
count
()).
toBe
(
0
);
const
scopedState
=
clinicStateStore
(
new
MeyerStore
(
join
(
directory
,
'state'
)),
meyerConfig
().
scopes
[
0
]
!
);
await
scopedState
.
write
(
'scope'
,
{
...
meyerConfig
().
scopes
[
0
],
sourceUnit
:
'changed-brand'
});
await
expect
(
runMeyerCli
(
args
)).
rejects
.
toThrow
(
'ownership mapping changed'
);
await
scopedState
.
write
(
'scope'
,
meyerConfig
().
scopes
[
0
]);
await
hostRecord
(
otherPatientId
);
await
hostRecord
(
otherPatientId
);
await
expect
(
runMeyerCli
([...
args
,
'--tick'
])).
rejects
.
toThrow
(
'conflicting'
);
await
expect
(
runMeyerCli
([...
args
,
'--tick'
])).
rejects
.
toThrow
(
'conflicting'
);
expect
(
await
prisma
.
patientFact
.
count
({
where
:
{
hostId
,
patientId
}
})).
toBe
(
4
);
expect
(
await
prisma
.
patientFact
.
count
({
where
:
{
hostId
,
patientId
}
})).
toBe
(
4
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment