123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>江苏医保电子凭证解码测试</title>
- <style>
- body {
- font-family: 'Microsoft YaHei', Arial, sans-serif;
- margin: 20px;
- background-color: #f5f5f5;
- }
- .container {
- max-width: 1200px;
- margin: 0 auto;
- background: white;
- padding: 20px;
- border-radius: 8px;
- box-shadow: 0 2px 10px rgba(0,0,0,0.1);
- }
- .title {
- color: #2c3e50;
- border-bottom: 3px solid #3498db;
- padding-bottom: 10px;
- margin-bottom: 20px;
- }
- .test-section {
- margin: 20px 0;
- padding: 15px;
- border: 1px solid #ddd;
- border-radius: 5px;
- background: #fafafa;
- }
- .button {
- background: #3498db;
- color: white;
- border: none;
- padding: 10px 20px;
- border-radius: 4px;
- cursor: pointer;
- margin: 5px;
- }
- .button:hover {
- background: #2980b9;
- }
- .success { background: #27ae60; }
- .warning { background: #f39c12; }
- .danger { background: #e74c3c; }
-
- .result {
- margin: 10px 0;
- padding: 10px;
- border-radius: 4px;
- white-space: pre-wrap;
- max-height: 400px;
- overflow-y: auto;
- }
- .result.success {
- background: #d4edda;
- border: 1px solid #c3e6cb;
- color: #155724;
- }
- .result.error {
- background: #f8d7da;
- border: 1px solid #f5c6cb;
- color: #721c24;
- }
- .result.info {
- background: #d1ecf1;
- border: 1px solid #bee5eb;
- color: #0c5460;
- }
-
- .business-types {
- display: grid;
- grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
- gap: 10px;
- margin: 15px 0;
- }
- .business-type {
- padding: 8px;
- border: 1px solid #ddd;
- border-radius: 4px;
- background: white;
- cursor: pointer;
- text-align: center;
- }
- .business-type:hover {
- background: #e3f2fd;
- border-color: #3498db;
- }
-
- .url-example {
- background: #f8f9fa;
- border: 1px solid #e9ecef;
- border-radius: 4px;
- padding: 10px;
- margin: 10px 0;
- font-family: 'Courier New', monospace;
- font-size: 14px;
- }
- </style>
- </head>
- <body>
- <div class="container">
- <h1 class="title">🏥 江苏医保电子凭证解码功能测试</h1>
-
- <div class="test-section">
- <h3>📋 功能说明</h3>
- <p>本页面用于测试江苏医保电子凭证解码功能,基于《医疗保障信息平台定点基线版医药机构接口规范 v0.9.9.15》中的1.14.6电子凭证解码接口实现。</p>
-
- <h4>🔗 调用接口格式:</h4>
- <div class="url-example">
- <!-- 独立接口方式 -->
- <strong>独立接口:</strong><br>
- http://localhost:8321/api/entry?param=jiangsu_qrcode_[业务类型]<br><br>
-
- <!-- 江苏医保子功能方式 -->
- <strong>子功能方式:</strong><br>
- http://localhost:8321/api/entry?param=jiangsu_qrcode_[业务类型]<br>
- http://localhost:8321/api/entry?param=jiangsu_ec_[业务类型]
- </div>
- </div>
- <div class="test-section">
- <h3>🎯 业务类型选择</h3>
- <p>请选择要测试的业务场景:</p>
-
- <div class="business-types">
- <div class="business-type" onclick="testEcDecode('01101')">
- <strong>01101</strong><br>门诊挂号
- </div>
- <div class="business-type" onclick="testEcDecode('01201')">
- <strong>01201</strong><br>门诊问诊
- </div>
- <div class="business-type" onclick="testEcDecode('01301')">
- <strong>01301</strong><br>门诊结算
- </div>
- <div class="business-type" onclick="testEcDecode('01302')">
- <strong>01302</strong><br>取药
- </div>
- <div class="business-type" onclick="testEcDecode('01102')">
- <strong>01102</strong><br>住院建档
- </div>
- <div class="business-type" onclick="testEcDecode('02121')">
- <strong>02121</strong><br>药店购药
- </div>
- </div>
- </div>
- <div class="test-section">
- <h3>⚡ 快速测试</h3>
- <button class="button" onclick="testEcDecode('01101')">测试门诊挂号 (01101)</button>
- <button class="button warning" onclick="testEcDecode('01301')">测试门诊结算 (01301)</button>
- <button class="button success" onclick="testEcDecode('02121')">测试药店购药 (02121)</button>
- <button class="button danger" onclick="testInvalidBusinessType()">测试无效业务类型</button>
- </div>
- <div class="test-section">
- <h3>🔧 系统测试</h3>
- <button class="button" onclick="testJiangsuInit()">测试江苏医保初始化</button>
- <button class="button" onclick="testJiangsuStatus()">检查江苏医保状态</button>
- <button class="button" onclick="testDllExists()">检查DLL文件</button>
- </div>
- <div class="test-section">
- <h3>📊 测试结果</h3>
- <div id="result" class="result info">
- 等待测试...
- </div>
- </div>
- </div>
- <script>
- const resultDiv = document.getElementById('result');
- const baseUrl = 'http://localhost:8321/api/entry';
- function showResult(title, data, isSuccess = true) {
- const timestamp = new Date().toLocaleString();
- const className = isSuccess ? 'success' : 'error';
-
- resultDiv.className = `result ${className}`;
- resultDiv.textContent = `[${timestamp}] ${title}\n\n${JSON.stringify(data, null, 2)}`;
- }
- function showLoading(message) {
- resultDiv.className = 'result info';
- resultDiv.textContent = `⏳ ${message}...`;
- }
- // 测试江苏医保电子凭证解码
- async function testEcDecode(businessType) {
- const url = `${baseUrl}?param=jiangsu_qrcode_${businessType}`;
-
- showLoading(`正在测试江苏医保电子凭证解码 (业务类型: ${businessType})`);
-
- try {
- const response = await fetch(url);
- const data = await response.json();
-
- const isSuccess = data.code === 200 && data.success !== false;
- const title = `江苏医保电子凭证解码测试 - 业务类型: ${businessType}`;
-
- showResult(title, data, isSuccess);
-
- // 显示详细的业务信息
- if (data.businessType) {
- console.log(`业务类型: ${data.businessType}`);
- }
- if (data.interfaceVersion) {
- console.log(`接口版本: ${data.interfaceVersion}`);
- }
-
- } catch (error) {
- showResult(`江苏医保电子凭证解码测试失败 - 业务类型: ${businessType}`, {
- error: error.message,
- url: url
- }, false);
- }
- }
- // 测试无效业务类型
- async function testInvalidBusinessType() {
- const invalidType = '99999'; // 无效的业务类型
- const url = `${baseUrl}?param=jiangsu_qrcode_${invalidType}`;
-
- showLoading('正在测试无效业务类型处理');
-
- try {
- const response = await fetch(url);
- const data = await response.json();
-
- const title = `无效业务类型测试 - ${invalidType}`;
- const isSuccess = data.code !== 200; // 期望失败
-
- showResult(title, data, isSuccess);
-
- } catch (error) {
- showResult('无效业务类型测试异常', {
- error: error.message,
- url: url
- }, false);
- }
- }
- // 测试江苏医保初始化
- async function testJiangsuInit() {
- const url = `${baseUrl}?param=jiangsu_init`;
-
- showLoading('正在测试江苏医保系统初始化');
-
- try {
- const response = await fetch(url);
- const data = await response.json();
-
- const isSuccess = data.success === true && data.code === 200;
- showResult('江苏医保系统初始化测试', data, isSuccess);
-
- } catch (error) {
- showResult('江苏医保初始化测试失败', {
- error: error.message,
- url: url
- }, false);
- }
- }
- // 测试江苏医保状态
- async function testJiangsuStatus() {
- const url = `${baseUrl}?param=jiangsu_status`;
-
- showLoading('正在检查江苏医保系统状态');
-
- try {
- const response = await fetch(url);
- const data = await response.json();
-
- const isSuccess = data.success === true;
- showResult('江苏医保系统状态检查', data, isSuccess);
-
- } catch (error) {
- showResult('江苏医保状态检查失败', {
- error: error.message,
- url: url
- }, false);
- }
- }
- // 测试DLL文件存在性
- async function testDllExists() {
- const url = `${baseUrl}?param=jiangsu_checkdll`;
-
- showLoading('正在检查江苏医保DLL文件');
-
- try {
- const response = await fetch(url);
- const data = await response.json();
-
- const isSuccess = data.success === true;
- showResult('江苏医保DLL文件检查', data, isSuccess);
-
- } catch (error) {
- showResult('DLL文件检查失败', {
- error: error.message,
- url: url
- }, false);
- }
- }
- // 页面加载时显示欢迎信息
- window.onload = function() {
- showResult('江苏医保电子凭证解码测试页面', {
- 功能说明: '基于江苏医保接口规范v0.9.9.15实现的1.14.6电子凭证解码功能',
- 支持的业务类型: [
- '01101 - 门诊挂号',
- '01201 - 门诊问诊',
- '01301 - 门诊结算',
- '01302 - 取药',
- '01102 - 住院建档',
- '02121 - 药店购药'
- ],
- 接口格式: 'http://localhost:8321/api/entry?param=jiangsu_qrcode_[业务类型]',
- 准备状态: '就绪,请选择测试功能'
- }, true);
- };
- </script>
- </body>
- </html>
|