Hsieh-Ting Lin
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # punch ```vb= Sub punch(row As Integer, isIn As Boolean) 'Sub punch() ' isIn = False ' row = 2 On Error GoTo ErrorHandler Dim html As HTMLDocument username = Start.Range("A" & row).Value password = Start.Range("B" & row).Value URL = "https://staff.kfsyscc.org/punch/" Randomize Dim temperature$ temperature = 36 + Round(Rnd, 1) Application.StatusBar = "Start Login Process" With edge Application.StatusBar = "Edge Driver was set to Headless" .SetCapability "ms:edgeOptions", "{" & """args"":[""headless""]" & "}" Application.StatusBar = "Launching Edge Web driver in headless mode....it might take a few seconds, be patient" .Start Application.StatusBar = "Loading login page..." .Get URL x = Now + 5 '<== capture current time and plus 5 second Do Until edge.FindElementsById("username").Count > 0 Or Now > x DoEvents Loop 'Here, how to handle if there's no connection? If Not isIn Then .FindElementByXpath("//*[@id='full-width-tab-1']/span/h5").Click Application.Wait (Now + TimeValue("0:00:01")) Application.StatusBar = "Fill in username and password..." .FindElementById("username").SendKeys (username) .FindElementById("outlined-adornment-password").SendKeys (password) Application.StatusBar = "Click Login" If isIn Then .FindElementByXpath("//*[@id='full-width-tabpanel-0']/div/span/main/div[1]/form/button/span[1]").Click Application.StatusBar = "Clicked" Else .FindElementByXpath("//*[@id='full-width-tabpanel-1']/div/span/main/div[1]/form/button/span[1]").Click Application.StatusBar = "Clicked" End If End With x = Now + 5 Do Until Not edge.FindElementByXpath("//*[@id='outlined-adornment-weight']") Is Nothing Or Now > x DoEvents Loop Application.StatusBar = "Fill in temperature" edge.FindElementById("outlined-adornment-weight").SendKeys (temperature) edge.FindElementByXpath("/html/body/div[3]/div[3]/div/div[2]/div[2]/div[1]/button[1]").Click edge.FindElementByXpath("/html/body/div[3]/div[3]/div/div[2]/div[2]/div[2]/button[1]").Click edge.FindElementByXpath("/html/body/div[3]/div[3]/div/div[2]/div[2]/div[3]/button[1]").Click edge.FindElementByXpath("/html/body/div[3]/div[3]/div/div[2]/div[2]/div[4]/button[1]").Click edge.FindElementByXpath("/html/body/div[3]/div[3]/div/div[3]/button").Click Application.Wait (Now + TimeValue("0:00:02")) Set dlg = edge.SwitchToAlert() txt = dlg.Text dlg.accept edge.FindElementByXpath("/html/body/div[2]/div[3]/div/div[3]/button").Click ErrorHandler: ' 錯誤處理用的程式碼 Application.StatusBar = "Reloaded" End Sub ``` # 2022/06 ```vb= Dim has_w_done as boolean Dim has_d_done as boolean Dim has_e_done as boolean Dim has_p_done as boolean Dim has_a_done as boolean Dim has_o_done as boolean sub set_done_false() has_w_done = False has_d_done = False has_e_done = False has_p_done = False has_a_done = False has_o_done = False end sub ' check if is done Sub batch_w() if has_w_done then exit sub batch("w") has_w_done=True End Sub Sub AllAuto() Application.onTime 7:15 set_done_false() 'call next cycle' ' call clear 'call following 6' 'schedule time' ' don the inside ' ' set done' End Sub ``` ## Framework * schedule * scrapy * public variable * batch process ## 06/20 ```vim set nocompatible filetype off set hidden " opening new file hides current instead of closing set nowrap " switch off line wrapping set tabstop=4 " Set tabs to 4 characaters wide set shiftwidth=4 " Set indentation width to match tab set expandtab " Use spaces instead of actual hard tabs set softtabstop=4 " Set the soft tab to match the hard tab width set backspace=indent,eol,start " Make bs work across line breaks etc set autoindent " Enable basic auto indentation set copyindent " Preserve manual indentation set number set shiftround set showmatch set ignorecase set smartcase set smarttab set hlsearch set incsearch set history=1000 set undolevels=1000 set wildmenu set wildcharm=<Tab> " Needed to open the wildmenu from shortcuts set clipboard=unnamed " Use system clipboard, bonus copy/paste between local & SSH set wildignore=*.swp,*.bak,*.pyc,*.class,*.o set title set ruler set novisualbell set noerrorbells set lazyredraw set laststatus=2 set cursorline " set colorcolumn=85 set background=dark set encoding=utf-8 set guifont=Consolas:h14:cANSI " netrw file browser settings let g:netrw_banner=0 " Hide the directory banner let g:netrw_liststyle=3 " 0=thin; 1=long; 2=wide; 3=tree filetype plugin indent on syntax on colorscheme koehler " Map Ctrl+[hjkl] to navigate windows vim style nnoremap <silent> <C-h> <C-w>h nnoremap <silent> <C-j> <C-w>j nnoremap <silent> <C-k> <C-w>k nnoremap <silent> <C-l> <C-w>l " Map Ctrl+[arrow] to navigate windows` nnoremap <silent> <C-Left> <C-w>h nnoremap <silent> <C-Down> <C-w>j nnoremap <silent> <C-Up> <C-w>k nnoremap <silent> <C-Right> <C-w>l " Increase/descrease window split size if bufwinnr(1) map + <C-W>+ map - <C-W>- endif " Pageup/down will scroll half-page and center the current line on the screen nnoremap <silent> <PageUp> <C-U>zz vnoremap <silent> <PageUp> <C-U>zz inoremap <silent> <PageUp> <C-O><C-U><C-O>zz nnoremap <silent> <PageDown> <C-D>zz vnoremap <silent> <PageDown> <C-D>zz inoremap <silent> <PageDown> <C-O><C-D><C-O>zz " F1 netrw file browser " nnoremap <silent> <F1> :Explore<CR> " F2 to toggle paste mode nnoremap <silent> <F2> :set paste!<CR> " F3 to remove all trailing whitespace nnoremap <silent> <F3> :let _s=@/ <Bar> :%s/\s\+$//e <Bar> :let @/=_s <Bar> :nohl <Bar> :unlet _s <CR> let mapleader="," " Open netrw filebrowser in current window, with current file selected nmap <leader>e :e .<CR> " Rotate windows nmap <leader>r <C-w>r " Quick save the current file nmap <leader>w :w<CR> " Insert empty line below nmap <silent> <leader><CR> o<ESC> " Clear search highlights nmap <silent> <leader><space> :noh<CR> " Close buffer without affecting splits nmap <leader>d :bprevious<CR>:bdelete #<CR> " Easy buffer navigation nmap <leader>n :bn<CR> nmap <leader>p :bp<CR> nmap <leader>b :buffer <Tab> " Load vimrc nmap <leader>v :e ~/.vimrc<CR> " Toggle/cycle line number modes nmap <leader>l :call CycleLineNumbers()<CR> function! CycleLineNumbers() if (&number == 1 && &relativenumber == 0) set relativenumber else if (&relativenumber == 1 && &number == 1) set norelativenumber set nonumber else set number set norelativenumber endif endif endfunc ``` ## 06/07 - [ ] 解析如何串接Google Sheet試算表寫入爬取的資料 ## 06/06 ``` https://ing.kfsyscc.org/ord-api/service POST { "api": "restfulApi", "method": "PUT", "tableName": "ORDPHRM", "queryItem": { "CONTENTS": "hypertension" }, "uniqKey": { "PHR_CODE": "HTN", "DOC_NO": "004506" }, "database": "production" } ``` ## 06/05 ```vb= Sub punch(row As Integer, isIn As Boolean) 'Sub punch() ' isIn = True ' row = 2 On Error GoTo ErrorHandler Dim html As HTMLDocument username = Start.Range("A" & row).Value password = Start.Range("B" & row).Value URL = "https://staff.kfsyscc.org/punch/" Randomize Dim temperature$ temperature = 36 + Round(Rnd, 1) Application.StatusBar = "Start Login Process" With edge Application.StatusBar = "Edge Driver was set to Headless" .SetCapability "ms:edgeOptions", "{" & """args"":[""headless""]" & "}" Application.StatusBar = "Launching Edge Web driver in headless mode....it might take a few seconds, be patient" .Start Application.StatusBar = "Loading login page..." .Get URL x = timer() + 5 '<== capture current time and plus 5 second Do Until edge.FindElementsById("username").Count > 0 Or timer() > x DoEvents Loop 'Here, how to handle if there's no connection? If Not isIn Then .FindElementByXpath("//*[@id='full-width-tab-1']/span/h5").Click Application.Wait (Now + TimeValue("0:00:01")) Application.StatusBar = "Fill in username and password..." .FindElementById("username").SendKeys (username) .FindElementById("outlined-adornment-password").SendKeys (password) Application.StatusBar = "Click Log in" .FindElementByXpath("//*[@id='full-width-tabpanel-0']/div/span/main/div[1]/form/button/span[1]").Click End With 'Timeout x = timer() + 5 Do Until Not edge.FindElementByXpath("//*[@id='outlined-adornment-weight']") Is Nothing Or timer() > x DoEvents Loop edge.FindElementById("outlined-adornment-weight").SendKeys (temperature) Stop edge.FindElementByXpath("/html/body/div[3]/div[3]/div/div[3]/button[1]/span[1]").Click Stop edge.SwitchToAlert().accept edge.FindElementByXpath("/html/body/div[2]/div[3]/div/div[3]/button").Click ErrorHandler: ' 錯誤處理用的程式碼 edge.Get URL End Sub ``` # 2022/05 ```vb= Sub excuteFirstAndLast() Dim rowNumEnd As Long rowNumEnd = Cells(Rows.Count, 1).End(xlUp).row For i = 2 To rowNumEnd Call FirstAndLast(i) Next End Sub Sub FirstAndLast(row As Long) Dim i As Long Dim values As Range Dim dates As Range Set values = Range("A" & row & ":" & "D" & row) Set dates = Range("E" & row & ":" & "H" & row) For i = 1 To values.Cells.Count If Not values.Item(i).Value = "x" And Not values.Item(i).Value = 8 Then Application.ActiveSheet.Range("I" & row).Value = values.Item(i).Value Application.ActiveSheet.Range("J" & row).Value = dates.Item(i).Value Exit For End If Next i For i = values.Cells.Count To 1 Step -1 If Not values.Item(i).Value = "x" And Not values.Item(i).Value = 8 Then Application.ActiveSheet.Range("K" & row).Value = values.Item(i).Value Application.ActiveSheet.Range("L" & row).Value = dates.Item(i).Value Exit For End If Next i End Sub ``` ![](https://i.imgur.com/BAmJZ0O.png) ## Freature: 數據整理機器人 - [ ] Get IO data - [ ] How to arrange the IO card - [ ] When cell select then active marcro ```vb= Private Sub Worksheet_SelectionChange(ByVal Target As range) If Selection.Count = 1 Then If Not Intersect(Target, range("C2")) Is Nothing Then MsgBox "Hi there" End If End If End Sub ``` - [ ] 處理登入後沒有病人被視為末登入的問題 - [ ] 改成判斷title是病歷系統 - [ ] if 有成功登入但病人是0的狀況 ## Feature:自動產生交班單 regex101: build, test, and debug regex - [ ] ### Active and Inactive - [ ] Write the function - [ ] Find the progress note URL - [ ] Find the Xpath of Assessment - [ ] Test the regex ``` 臆斷 (IMPRESSION) [Active] xxxxxx [Underlying disease] xxxxxx 計劃與目標 (PLAN TO DO & GOAL) ``` - [ ] 用藥 ``` 目前用藥(不含ST) Espin EM * cap 100 mg 1 CAP QD PO 2022-05-25-2022-06-08 N Plavix FC tab 75 mg 1 TAB QD PO 2022-05-25-2022-06-08 N Concor FC * tab 1.25 mg 1 TAB QD PO 2022-05-25-2022-06-08 N Agglutex ##* inj 25000 u/5ml/vl X1 VL ONCE IVA 2022-05-26-2022-05-27 Y LIXIANA FC #* tab 60 mg 1 TAB QD PO 2022-05-26-2022-06-09 N Norvasc * tab 5 mg 1 TAB QD PO 2022-05-26-2022-06-09 N LIPITOR FC * TAB 20 MG 1 TAB QD PO 2022-05-26-2022-06-09 N 自備用藥 ``` - [ ] APACH II https://web9.vghtpe.gov.tw/emr2/icueval/Apache.do?action=browse&phistnum=15124013&pcaseno=28605269 ``` //*[@id="ApacheItem2"]/td/table/tbody/tr[23]/td[3] ```

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully