feat(route): cde xxgk (#10094)

* feat(route): cde xxgk

* docs: fix example

* docs: fix path
This commit is contained in:
Tony 2022-07-01 18:21:46 +01:00 committed by GitHub
parent c388cfac5e
commit cdd1d2fea5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 163 additions and 8 deletions

View File

@ -239,6 +239,16 @@ pageClass: routes
</Route>
### 信息公开
<Route author="TonyRL" example="/cde/xxgk/priorityApproval" path="/cde/xxgk/:category" :paramsDesc="['类别,见下表']" radar="1" rssbud="1">
| 优先审评公示 | 突破性治疗公示 | 临床试验默示许可 |
| :--------------: | :--------------: | :------: |
| priorityApproval | breakthroughCure | cliniCal |
</Route>
## 哈尔滨市科技局
### 政务公开

View File

@ -104,7 +104,7 @@ module.exports = async (ctx) => {
const items = await Promise.all(
list.map((item) =>
ctx.cache.tryGet(item.link, async () => {
const detailResponse = await got.get(item.link, {
const detailResponse = await got(item.link, {
headers: {
cookie: await utils.getCookie(ctx),
},
@ -126,7 +126,7 @@ module.exports = async (ctx) => {
ctx.state.data = {
title: `${utils.title} - ${cateTitleMap[channel][cate]}`,
link: String(channelLinkMap[channel]),
link: channelLinkMap[channel],
item: items,
};
};

View File

@ -1,3 +1,4 @@
module.exports = {
'/xxgk/:category': ['TonyRL'],
'/:channel/:category': ['Fatpandac'],
};

View File

@ -11,19 +11,19 @@ module.exports = {
{
title: '要闻导读',
docs: 'https://docs.rsshub.app/government.html#guo-jia-yao-pin-shen-ping-wang-zhan-shou-ye',
source: ['/main/news/listpage/545cf855a50574699b46b26bcb165f32'],
source: ['/main/news/listpage/1e0a362d64015ebcbf32d6949acbba11'],
target: '/cde/news/ywdd',
},
{
title: '图片新闻',
docs: 'https://docs.rsshub.app/government.html#guo-jia-yao-pin-shen-ping-wang-zhan-shou-ye',
source: ['/main/news/listpage/545cf855a50574699b46b26bcb165f32'],
source: ['/main/news/listpage/4b49e3142441860ac6a48c888a54712a'],
target: '/cde/news/tpxw',
},
{
title: '工作动态',
docs: 'https://docs.rsshub.app/government.html#guo-jia-yao-pin-shen-ping-wang-zhan-shou-ye',
source: ['/main/news/listpage/545cf855a50574699b46b26bcb165f32'],
source: ['/main/news/listpage/3cc45b396497b598341ce3af000490e5'],
target: '/cde/news/gzdt',
},
{
@ -35,9 +35,27 @@ module.exports = {
{
title: '中心规章',
docs: 'https://docs.rsshub.app/government.html#guo-jia-yao-pin-shen-ping-wang-zhan-shou-ye',
source: ['/main/policy/listpage/9f9c74c73e0f8f56a8bfbc646055026d'],
source: ['/main/policy/listpage/369ac7cfeb67c6000c33f85e6f374044'],
target: '/cde/policy/zxgz',
},
{
title: '优先审评公示 - 信息公开',
docs: 'https://docs.rsshub.app/government.html#guo-jia-yao-pin-shen-ping-wang-zhan-shou-ye',
source: ['/main/xxgk/listpage/2f78f372d351c6851af7431c7710a731'],
target: '/cde/xxgf/priorityApproval',
},
{
title: '突破性治疗公示 - 信息公开',
docs: 'https://docs.rsshub.app/government.html#guo-jia-yao-pin-shen-ping-wang-zhan-shou-ye',
source: ['/main/xxgk/listpage/da6efd086c099b7fc949121166f0130c'],
target: '/cde/xxgf/breakthroughCure',
},
{
title: '临床试验默示许可 - 信息公开',
docs: 'https://docs.rsshub.app/government.html#guo-jia-yao-pin-shen-ping-wang-zhan-shou-ye',
source: ['/main/xxgk/listpage/4b5255eb0a84820cef4ca3e8b6bbe20c'],
target: '/cde/xxgf/cliniCal',
},
],
},
};

View File

@ -1,3 +1,4 @@
module.exports = function (router) {
router.get('/xxgk/:category', require('./xxgk'));
router.get('/:channel/:category', require('./index'));
};

View File

@ -0,0 +1,18 @@
<table>
<tr>
<th>受理号</th>
<th>药品名称</th>
<th>注册申请人</th>
<th>申请日期</th>
<th>公示日期</th>
<th>公示截止日期</th>
</tr>
<tr>
<td>{{ item.acceptid }}</td>
<td>{{ item.drgnamecn }}</td>
<td>{{ item.company }}</td>
<td>{{ item.applyDate }}</td>
<td>{{ item.noticeDate }}</td>
<td>{{ item.endNoticeDate }}</td>
</tr>
</table>

View File

@ -0,0 +1,16 @@
<table>
<tr>
<th>受理号</th>
<th>药品名称</th>
<th>申请人名称</th>
<th>适应症</th>
<th>注册分类</th>
</tr>
<tr>
<td>{{ item.acceptid }}</td>
<td>{{ item.drgnamecn }}</td>
<td>{{ item.companys }}</td>
<td>{{ item.lcmsxkIndication }}</td>
<td>{{ item.lcmsxkRegisterkind }}</td>
</tr>
</table>

View File

@ -0,0 +1,18 @@
<table>
<tr>
<th>受理号</th>
<th>药品名称</th>
<th>注册申请人</th>
<th>承办日期</th>
<th>申请日期</th>
<th>公示日期</th>
</tr>
<tr>
<td>{{ item.acceptid }}</td>
<td>{{ item.drgnamecn }}</td>
<td>{{ item.company }}</td>
<td>{{ item.createdate }}</td>
<td>{{ item.applyDate }}</td>
<td>{{ item.noticeDate }}</td>
</tr>
</table>

View File

@ -4,8 +4,8 @@ const title = '国家药品监督管理局药品审评中心';
const rootUrl = 'https://www.cde.org.cn';
const getCookie = (ctx) =>
ctx.cache.tryGet(rootUrl, async () => {
const response = await got.get(rootUrl);
ctx.cache.tryGet('cde:cookie', async () => {
const response = await got(rootUrl);
return response.headers['set-cookie']
.join()

73
lib/v2/cde/xxgk.js Normal file
View File

@ -0,0 +1,73 @@
const got = require('@/utils/got');
const { parseDate } = require('@/utils/parse-date');
const { art } = require('@/utils/render');
const path = require('path');
const utils = require('./utils');
const baseUrl = 'https://www.cde.org.cn';
const xxgkMap = {
xxgk: {
priorityApproval: {
title: '优先审评公示',
url: `${baseUrl}/main/xxgk/listpage/2f78f372d351c6851af7431c7710a731`,
endPoint: '/priority/getPriorityApprovalList',
form: {
pageSize: 50,
pageNum: 1,
noticeType: 2,
acceptid: '',
drugname: '',
company: '',
},
},
breakthroughCure: {
title: '突破性治疗公示',
url: `${baseUrl}/main/xxgk/listpage/da6efd086c099b7fc949121166f0130c`,
endPoint: '/breakthrough/getBreakthroughCureList',
form: {
pageSize: 50,
pageNum: 1,
noticeType: 1,
acceptid: '',
drugname: '',
company: '',
},
},
cliniCal: {
title: '临床试验默示许可',
url: `${baseUrl}/main/xxgk/listpage/4b5255eb0a84820cef4ca3e8b6bbe20c`,
endPoint: '/xxgk/getCliniCalList',
form: {
pageSize: 50,
pageNum: 1,
condition: '',
},
},
},
};
module.exports = async (ctx) => {
const { category } = ctx.params;
const { data } = await got.post(`${baseUrl}/main${xxgkMap.xxgk[category].endPoint}`, {
form: xxgkMap.xxgk[category].form,
headers: {
referer: xxgkMap.xxgk[category].url,
cookie: await utils.getCookie(ctx),
},
});
const items = data.data.records.map((item) => ({
title: item.drgnamecn,
guid: item.acceptid,
pubDate: item.endNoticeDate ? parseDate(item.endNoticeDate) : null,
description: art(path.join(__dirname, `templates/xxgk/${category}.art`), { item }),
link: xxgkMap.xxgk[category].url,
}));
ctx.state.data = {
title: `${xxgkMap.xxgk[category].title} - 国家药品监督管理局药品审评中心`,
link: xxgkMap.xxgk[category].url,
item: items,
};
};