Merge branch 'master' of http://git.zhenyangtang.com.cn/ZYT/zyt
This commit is contained in:
@@ -7,18 +7,31 @@ namespace app\common\service;
|
||||
/** Single entry point for references attached to clinical model requests. */
|
||||
final class ClinicalKnowledgeReference
|
||||
{
|
||||
/** Case reports retain response rules without importing textbook patient-like findings. */
|
||||
public static function augmentCaseQuery(string $query, bool $consultation = false): string
|
||||
{
|
||||
$boundary = '[TCM_CASE_SOURCE_BOUNDARY:v1]' . "\n"
|
||||
. '本例事实和方药依据只能来自给定患者资料,保留否定、程度、日期与未知状态;'
|
||||
. '不得用教材或古籍的常见方证补写本例症状或阴性体征。历史方药保留原时点与状态,仅作原始记录。';
|
||||
$prefix = ($consultation ? TcmClinicalResponsePolicy::consultationReference()
|
||||
: TcmClinicalResponsePolicy::reference()) . "\n\n" . $boundary . "\n\n";
|
||||
return str_starts_with($query, $prefix) ? $query : $prefix . $query;
|
||||
}
|
||||
|
||||
public static function augmentQuery(string $query): string
|
||||
{
|
||||
return TcmAncientBooksReference::augmentQuery(NihaixiaClinicalSkill::augmentQuery($query));
|
||||
return TcmClinicalResponsePolicy::augmentQuery(
|
||||
TcmAncientBooksReference::augmentQuery(NihaixiaClinicalSkill::augmentQuery($query))
|
||||
);
|
||||
}
|
||||
|
||||
/** @param list<array<string,mixed>> $ancientBookSources */
|
||||
public static function augmentQueryWithAncientBookSources(string $query, array $ancientBookSources): string
|
||||
{
|
||||
return TcmAncientBooksReference::augmentQueryWithSources(
|
||||
return TcmClinicalResponsePolicy::augmentQuery(TcmAncientBooksReference::augmentQueryWithSources(
|
||||
NihaixiaClinicalSkill::augmentQuery($query),
|
||||
$ancientBookSources
|
||||
);
|
||||
));
|
||||
}
|
||||
|
||||
/** @param array<int,array<string,mixed>> $messages
|
||||
@@ -26,7 +39,9 @@ final class ClinicalKnowledgeReference
|
||||
*/
|
||||
public static function augmentMessages(array $messages): array
|
||||
{
|
||||
return TcmAncientBooksReference::augmentMessages(NihaixiaClinicalSkill::augmentMessages($messages));
|
||||
return TcmClinicalResponsePolicy::augmentMessages(
|
||||
TcmAncientBooksReference::augmentMessages(NihaixiaClinicalSkill::augmentMessages($messages))
|
||||
);
|
||||
}
|
||||
|
||||
/** @return list<array<string,mixed>> */
|
||||
|
||||
Reference in New Issue
Block a user